/** * @param InputInterface $input * @param OutputInterface $output * * @return int */ public function doRun(InputInterface $input, OutputInterface $output) { $this->addBaseCommands(); $discovery = $this->getKernel()->getContainer()->get('puli_discovery'); foreach ($discovery->findBindings(self::COMMAND_BINDING_TYPE) as $binding) { if ($binding instanceof ClassBinding) { $className = $binding->getClassName(); $command = new $className(); if ($command instanceof Command) { if ($command instanceof ContainerAwareCommand) { $command->setContainer($this->kernel->getContainer()); } $this->add($command); } } } return parent::doRun($input, $output); }
<?php use Hopus\Common\Kernel; require './../vendor/autoload.php'; $kernel = new Kernel(__DIR__ . '/../config/config.yml', __DIR__ . '/../', false); $response = $kernel->boot(); $response->send();