コード例 #1
0
ファイル: IndexCommand.php プロジェクト: vvval/spiral
 /**
  * @param Indexer                    $indexer
  * @param InvocationLocatorInterface $invocationLocator
  * @param ClassLocatorInterface      $classLocator
  */
 public function perform(Indexer $indexer, InvocationLocatorInterface $invocationLocator, ClassLocatorInterface $classLocator)
 {
     if ($invocationLocator instanceof LoggerAwareInterface) {
         //Way too much verbosity
         $invocationLocator->setLogger(new NullLogger());
     }
     if ($classLocator instanceof LoggerAwareInterface) {
         //Way too much verbosity
         $classLocator->setLogger(new NullLogger());
     }
     $this->writeln("<info>Scanning translate function usages...</info>");
     $indexer->indexInvocations($invocationLocator);
     $this->writeln("<info>Scanning Translatable classes...</info>");
     $indexer->indexClasses($classLocator);
 }
コード例 #2
0
ファイル: IndexCommand.php プロジェクト: jwdeitch/spiral
 /**
  * Perform command.
  *
  * @param Indexer $indexer
  */
 public function perform(Indexer $indexer)
 {
     $this->writeln("Scanning translate function usages...");
     $this->isVerbosing() && $indexer->events()->listen('string', $this->stringListener());
     if ($this->option('directory')) {
         $indexer->indexDirectory($this->option('directory'));
     } else {
         foreach ($this->tokenizer->config()['directories'] as $directory) {
             $indexer->indexDirectory($directory, $this->tokenizer->config()['exclude']);
         }
     }
     $this->writeln("Scanning Translatable classes...");
     $indexer->indexClasses();
     $this->writeln("<info>Strings found: <comment>{$indexer->countStrings()}</comment> " . "in <comment>{$indexer->countBundles()}</comment> bundle(s).</info>");
 }