From 9b2e12f6d5543f7d441e7d91ae57e16644aada53 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 3 Dec 2016 15:15:10 +0100 Subject: [PATCH] Don't load class cache and bootstrap file on php 7. --- web/app.php | 8 ++++++-- web/app_dev.php | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web/app.php b/web/app.php index 6bd0ea0168..c1ac2853f7 100644 --- a/web/app.php +++ b/web/app.php @@ -4,10 +4,14 @@ /** @var \Composer\Autoload\ClassLoader $loader */ $loader = require __DIR__.'/../app/autoload.php'; -include_once __DIR__.'/../var/bootstrap.php.cache'; +if (PHP_VERSION_ID < 70000) { + include_once __DIR__.'/../var/bootstrap.php.cache'; +} $kernel = new AppKernel('prod', false); -$kernel->loadClassCache(); +if (PHP_VERSION_ID < 70000) { + $kernel->loadClassCache(); +} //$kernel = new AppCache($kernel); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter diff --git a/web/app_dev.php b/web/app_dev.php index 1309adda39..45daacfdc5 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -23,7 +23,9 @@ Debug::enable(); $kernel = new AppKernel('dev', true); -$kernel->loadClassCache(); +if (PHP_VERSION_ID < 70000) { + $kernel->loadClassCache(); +} $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send();