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; }
protected function registerEventCommands() { $this->kernel->getContainer()->load('plugins'); /** @var \Enlight_Event_EventManager $eventManager */ $eventManager = $this->kernel->getContainer()->get('events'); $collection = new ArrayCollection(); $collection = $eventManager->collect('Shopware_Console_Add_Command', $collection, array('subject' => $this)); /** @var $command Command */ foreach ($collection as $command) { if ($command instanceof Command) { $this->add($command); } } }
/** * Returns HttpKernel service container. * * @return ContainerInterface */ public function getContainer() { return $this->kernel->getContainer(); }
/** * Boots HttpKernel before each scenario. */ public function bootKernel() { $this->kernel->boot(); }
echo file_get_contents(__DIR__ . '/recovery/update/maintenance.html'); return; } // Check for active auto update if (is_file('files/update/update.json')) { header('Content-type: text/html; charset=utf-8', true, 503); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 1200'); echo file_get_contents(__DIR__ . '/recovery/update/maintenance.html'); return; } // check for composer autoloader if (!file_exists('vendor/autoload.php')) { header('Content-type: text/html; charset=utf-8', true, 503); echo '<h2>Error</h2>'; echo 'Please execute "composer install" from the command line to install the required dependencies for Shopware 4'; echo '<h2>Fehler</h2>'; echo 'Bitte führen Sie zuerst "composer install" aus.'; return; } require __DIR__ . '/autoload.php'; use Shopware\Kernel; use Shopware\Components\HttpCache\AppCache; use Symfony\Component\HttpFoundation\Request; $environment = getenv('ENV') ?: getenv('REDIRECT_ENV') ?: 'production'; $kernel = new Kernel($environment, $environment !== 'production'); if ($kernel->isHttpCacheEnabled()) { $kernel = new AppCache($kernel, $kernel->getHttpCacheConfig()); } $request = Request::createFromGlobals(); $kernel->handle($request)->send();
protected function prepareContainer(ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__)); $loader->load('services.xml'); return parent::prepareContainer($container); }