Skip to content

Commit 13da5dc

Browse files
committed
Fix error with class redeclaration: Do not load cache files on PHP 7
1 parent e9dc416 commit 13da5dc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

web/app.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
* @var Composer\Autoload\ClassLoader
1212
*/
1313
$loader = require __DIR__.'/../app/autoload.php';
14-
include_once __DIR__.'/../var/bootstrap.php.cache';
14+
if (PHP_VERSION_ID < 70000) {
15+
include_once __DIR__.'/../var/bootstrap.php.cache';
16+
}
1517

1618
// If your web server provides APC support for PHP applications, uncomment these
1719
// lines to use APC for class autoloading. This can improve application performance
@@ -27,7 +29,9 @@
2729
// $apcLoader->register(true);
2830

2931
$kernel = new AppKernel('prod', false);
30-
$kernel->loadClassCache();
32+
if (PHP_VERSION_ID < 70000) {
33+
$kernel->loadClassCache();
34+
}
3135

3236
// When using the HTTP Cache to improve application performance, the application
3337
// kernel is wrapped by the AppCache class to activate the built-in reverse proxy.

web/app_dev.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
Debug::enable();
3030

3131
$kernel = new AppKernel('dev', true);
32-
$kernel->loadClassCache();
32+
if (PHP_VERSION_ID < 70000) {
33+
$kernel->loadClassCache();
34+
}
3335
$request = Request::createFromGlobals();
3436
$response = $kernel->handle($request);
3537
$response->send();

0 commit comments

Comments
 (0)