コード例 #1
0
 protected function doExecute(BundleInterface $bundle, $force, $methodToCall, OutputInterface $output)
 {
     $starttime = microtime(true);
     $message = null;
     if ($force) {
         $message = "\n\n" . sprintf(' ✓  %s of bundle "%s" started.', ucfirst($this->getCommandType()), $bundle->getId()) . "\n\n";
     } else {
         $message = "\n\n" . sprintf(' ✓  Getting information about %s of bundle "%s"...', $this->getCommandType(), $bundle->getId()) . "\n\n";
     }
     $output->writeln($message);
     $logs = $this->getContainer()->get('bundle.loader')->{$methodToCall}($bundle, $force);
     if ($force) {
         $output->writeln(sprintf(' ✓  %s of bundle "%s" completed in %s.', ucfirst($this->getCommandType()), $bundle->getId(), number_format(microtime(true) - $starttime, 3) . ' s') . "\n\n");
     }
     $output->writeln('SQL:' . (0 < count($logs['sql']) ? '' : ' -'));
     foreach ($logs['sql'] as $sql) {
         $output->writeln($sql);
     }
     unset($logs['sql']);
     foreach ($logs as $key => $other) {
         foreach ((array) $other as $message) {
             $output->writeln(sprintf('[%s] %s', ucfirst($key), $message));
         }
     }
 }
コード例 #2
0
ファイル: BundleLoader.php プロジェクト: nietzcheson/BackBee
 /**
  * Returns bundle entity directory path.
  *
  * @param  BundleInterface $bundle
  * @return string
  */
 protected function getBundleEntityDir(BundleInterface $bundle)
 {
     return $bundle->getBaseDirectory() . DIRECTORY_SEPARATOR . 'Entity';
 }