50 protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface
$output): int
52 $vn = (
$output->getVerbosity() > Console\Output\OutputInterface::VERBOSITY_QUIET);
53 $vv = (
$output->getVerbosity() >= Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE);
55 $path = $input->getOption(
'path');
60 $memoryBefore = \memory_get_usage();
61 $output->writeln(
'--------Translate::index-----------');
62 $output->writeln(
"Indexing path: {$path}");
74 $pathLang::$verbose = $vv;
75 $output->write(
"PathLangCollection::purge..");
83 $output->writeln(
"\tdone\t{$time}sec");
84 $output->write(
"PathLangCollection::collect..");
92 $output->writeln(
"\tdone\t{$time}sec");
100 $pathIndex::$verbose = $vv;
101 $output->write(
"PathIndexCollection::purge..");
104 $pathIndex->purge($filt)->unvalidate($filt);
108 $output->writeln(
"\tdone\t{$time}sec");
109 $output->write(
"PathIndexCollection::collect..");
112 $pathIndex->collect($filt);
117 $output->writeln(
"\tdone\t{$time}sec");
125 $fileIndex::$verbose = $vv;
126 $output->write(
"FileIndexCollection::collect..");
129 $fileIndex->collect($filt);
134 $output->writeln(
"\tdone\t{$time}sec");
142 $phraseIndex::$verbose = $vv;
143 $output->write(
"PhraseIndexCollection::collect..");
146 $phraseIndex->collect($filt);
147 $pathIndex->validate($filt,
false);
153 $output->writeln(
"\tdone\t{$time}sec");
155 $memoryAfter = \memory_get_usage();
156 $memoryDiff = $memoryAfter - $memoryBefore;
157 $output->writeln(
'Memory usage: '.(\round($memoryAfter/1024/1024, 1)).
'M (+'.(\round($memoryDiff/1024/1024, 1)).
'M)');
158 $output->writeln(
'Memory peak usage: '.(\round(\memory_get_peak_usage()/1024/1024, 1)).
'M');