registerCommands() public method

Override this method if your bundle commands do not follow the conventions: * Commands are in the 'Command' sub-directory * Commands extend Symfony\Component\Console\Command\Command
public registerCommands ( Application $application )
$application Symfony\Component\Console\Application An Application instance
 public function registerCommands(Application $app)
 {
     if ($app instanceof FrameworkApplication) {
         $this->addConsoleHelpers($app);
     }
     return parent::registerCommands($app);
 }
 public function registerCommands(Application $application)
 {
     if (!$application instanceof FrameworkApplication) {
         return parent::registerCommands($application);
     }
     if (!(false === ($apc = $application->getKernel()->getContainer()->getParameter('cachetool.apc')) xor false === $application->getKernel()->getContainer()->getParameter('cachetool.opcache'))) {
         return parent::registerCommands($application);
     }
     if (!is_dir($dir = $this->getPath() . '/Command')) {
         return;
     }
     $finder = new Finder();
     $finder->files()->name(($apc ? 'Apc' : 'Opcache') . '*Command.php')->in($dir);
     $prefix = $this->getNamespace() . '\\Command';
     foreach ($finder as $file) {
         $ns = $prefix;
         if ($relativePath = $file->getRelativePath()) {
             $ns .= '\\' . strtr($relativePath, '/', '\\');
         }
         $class = $ns . '\\' . $file->getBasename('.php');
         if ($this->container) {
             $alias = 'console.command.' . strtolower(str_replace('\\', '_', $class));
             if ($this->container->has($alias)) {
                 continue;
             }
         }
         $r = new \ReflectionClass($class);
         if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
             $application->add($r->newInstance());
         }
     }
 }
 public function registerCommands(Application $application)
 {
     parent::registerCommands($application);
     //include Doctrine ORM commands if exist
     if (class_exists('Doctrine\\ORM\\Version')) {
         ConsoleRunner::addCommands($application);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function registerCommands(Application $application)
 {
     parent::registerCommands($application);
     $container = $application->getKernel()->getContainer();
     if ($container->has('ekino.new_relic')) {
         $newrelic = $container->get('ekino.new_relic');
         $application->add(new NotifyDeploymentCommand($newrelic));
     }
 }
 /**
  * @inheritDoc
  */
 public function registerCommands(Application $application)
 {
     parent::registerCommands($application);
     if (class_exists('\\Jackalope\\Tools\\Console\\Command\\JackrabbitCommand')) {
         $application->add(new JackrabbitCommand());
     }
     if (class_exists('\\Jackalope\\Tools\\Console\\Command\\InitDoctrineDbalCommand')) {
         $application->add(new InitDoctrineDbalCommand());
     }
 }
 public function registerCommands(Application $application)
 {
     if (!defined('ARTISAN_BINARY')) {
         define('ARTISAN_BINARY', $this->container->getParameter('kernel.root_dir') . '/console');
     }
     parent::registerCommands($application);
     $app = $this->container->get('cu_labs_illuminate.container');
     $bridgeApplication = new BridgeApplication($app, $app['events'], 'laravel', $application);
     $app['events']->fire('artisan.start', [$bridgeApplication]);
 }
 public function registerCommands(Application $application)
 {
     parent::registerCommands($application);
     if (!method_exists($application, 'getKernel')) {
         return;
     }
     $container = $application->getKernel()->getContainer();
     $commands = $container->getParameter(CommandLineAnnotationContainerGenerator::CONTAINER_COMMANDS_PARAMETER);
     foreach ($commands as $commandParameter) {
         $command = new ServiceCommand($commandParameter['name'], $commandParameter['shortDesc'], $commandParameter['paramsArray'], $commandParameter['serviceName'], $commandParameter['methodName'], $container->get(IInvoker::NUCLEUS_SERVICE_NAME), $container);
         $application->add($command);
     }
 }
 /**
  * @inheritDoc
  */
 public function registerCommands(Application $application)
 {
     parent::registerCommands($application);
     if (class_exists('Doctrine\\ODM\\PHPCR\\Version')) {
         $application->add(new InfoDoctrineCommand());
         $application->add(new DocumentMigrateClassCommand());
     }
     if (class_exists('\\Jackalope\\Tools\\Console\\Command\\JackrabbitCommand')) {
         $application->add(new JackrabbitCommand());
     }
     if (class_exists('\\Jackalope\\Tools\\Console\\Command\\InitDoctrineDbalCommand')) {
         $application->add(new InitDoctrineDbalCommand());
     }
 }
 /**
  * {@inheritDoc}
  */
 public function registerCommands(Application $application)
 {
     // Use the default logic when the ORM is available.
     // This avoids listing all ORM commands by hand.
     if (class_exists('Doctrine\\ORM\\Version')) {
         parent::registerCommands($application);
         return;
     }
     // Register only the DBAL commands if the ORM is not available.
     $application->add(new CreateDatabaseDoctrineCommand());
     $application->add(new DropDatabaseDoctrineCommand());
     $application->add(new RunSqlDoctrineCommand());
 }
示例#10
0
 public function registerCommands(Application $application)
 {
     if ($this->hasCommands()) {
         parent::registerCommands($application);
     }
 }
示例#11
0
 public function registerCommands(Application $application)
 {
     parent::registerCommands($application);
     $application->add($this->container->get('bernard.command.consume'));
     $application->add($this->container->get('bernard.command.produce'));
 }
 /**
  * @param Application $application
  */
 public function registerCommands(Application $application)
 {
     parent::registerCommands($application);
     $commandRegistry = $this->container->get('seiffert_console_extra.command_registry');
     $application->addCommands($commandRegistry->getCommands());
 }