$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(); // If you are behind one or more trusted reverse proxies, you might want to set them in TRUSTED_PROXIES environment // variable in order to get correct client IP if (($trustedProxies = getenv("TRUSTED_PROXIES")) !== false) { Request::setTrustedProxies(explode(",", $trustedProxies)); } $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);
<?php require_once __DIR__ . '/../app/autoload.php'; require_once __DIR__ . '/../app/EzPublishKernel.php'; require_once __DIR__ . '/../app/EzPublishCache.php'; use eZ\Publish\MVC\SiteAccess\Router as SiteAccessRouter; use Symfony\Component\HttpFoundation\Request; $kernel = new EzPublishKernel('dev', true); $kernelCache = new EzPublishCache($kernel); $kernelCache->handle(Request::createFromGlobals())->send();