protected function getSWKernel() { if (!static::$kernel) { // shopware "destroys" the include path $originalIncludePath = get_include_path(); require_once rtrim($this->getSWPath(), '/\\') . DIRECTORY_SEPARATOR . 'autoload.php'; $newIncludePath = get_include_path(); set_include_path(rtrim($originalIncludePath, PATH_SEPARATOR) . PATH_SEPARATOR . $newIncludePath); static::$kernel = new Kernel($environment = getenv('ENV') ?: getenv('REDIRECT_ENV') ?: 'production', $environment !== 'production'); static::$kernel->boot(); } // if return static::$kernel; }
/** * Runs the current application. * * @param InputInterface $input An Input instance * @param OutputInterface $output An Output instance * * @return integer 0 if everything went fine, or an error code */ public function doRun(InputInterface $input, OutputInterface $output) { $this->kernel->boot(); if (!$this->commandsRegistered) { $this->registerCommands($output); $this->commandsRegistered = true; } $container = $this->kernel->getContainer(); foreach ($this->all() as $command) { if ($command instanceof ContainerAwareInterface) { $command->setContainer($container); } } if (true === $input->hasParameterOption(array('--shell', '-s'))) { $shell = new Shell($this); $shell->setProcessIsolation($input->hasParameterOption(array('--process-isolation'))); $shell->run(); return 0; } return parent::doRun($input, $output); }
/** * Boots HttpKernel before each scenario. */ public function bootKernel() { $this->kernel->boot(); }