public static function getContainer(Event $event) { $extra = $event->getComposer()->getPackage()->getExtra(); $kernelrootdir = rtrim(getcwd(), '/') . '/' . trim($extra['symfony-app-dir'], '/'); require_once "{$kernelrootdir}/EzPublishKernel.php"; $kernel = new \EzPublishKernel("dev", FALSE); $kernel->boot(); return $kernel->getContainer(); }
public function initialize(\Boris\Boris $boris, $dir) { parent::initialize($boris, $dir); require "{$dir}/ezpublish/bootstrap.php.cache"; require_once "{$dir}/ezpublish/EzPublishKernel.php"; $kernel = new \EzPublishKernel('dev', true); $kernel->loadClassCache(); $kernel->boot(); $boris->onStart(function ($worker, $vars) use($kernel) { $worker->setLocal('kernel', $kernel); $worker->setLocal('container', $kernel->getContainer()); }); }
$loader = (require_once __DIR__ . '/../ezpublish/autoload.php'); } else { $loader = (require_once __DIR__ . '/../ezpublish/bootstrap.php.cache'); } // Depending on the USE_APC_CLASSLOADER environment variable, use APC for autoloading to improve performance. // If not set it is not used. if (getenv("USE_APC_CLASSLOADER")) { $prefix = getenv("APC_CLASSLOADER_PREFIX"); $loader = new ApcClassLoader($prefix ?: "ezpublish", $loader); $loader->register(true); } require_once __DIR__ . '/../ezpublish/EzPublishKernel.php'; if ($useDebugging) { Debug::enable(); } $kernel = new EzPublishKernel($environment, $useDebugging); // we don't want to use the classes cache if we are in a debug session if (!$useDebugging) { $kernel->loadClassCache(); } // Depending on the USE_HTTP_CACHE environment variable, tells whether the internal HTTP Cache mechanism is to be used. // If not set it is activated if not in "dev" environment. if (($useHttpCache = getenv("USE_HTTP_CACHE")) === false) { $useHttpCache = $environment !== "dev"; } // Load HTTP Cache ... if ($useHttpCache) { require_once __DIR__ . '/../ezpublish/EzPublishCache.php'; $kernel = new EzPublishCache($kernel); } $request = Request::createFromGlobals();
<?php use Symfony\Component\HttpFoundation\Request; require_once __DIR__ . '/../ezpublish/autoload.php'; require_once __DIR__ . '/../ezpublish/EzPublishKernel.php'; require_once __DIR__ . '/../ezpublish/EzPublishCache.php'; $kernel = new EzPublishKernel('dev', true); $kernel->loadClassCache(); // Uncomment the following to activate HttpCache. //$kernel = new EzPublishCache( $kernel ); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);