Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit e21e941

Browse files
committed
feature #1030 Don't load class cache and bootstrap file on php 7 (derrabus)
This PR was merged into the 3.3-dev branch. Discussion ---------- Don't load class cache and bootstrap file on php 7 As discussed in symfony/symfony#20668, the class cache features should be deprecated. Since the class cache and the bootstrap file are still useful on php 5, we load them only when running on php 5. A future php-7-only release of Symfony Standard should remove those blocks completely. Commits ------- 9b2e12f Don't load class cache and bootstrap file on php 7.
2 parents 98f42c7 + 9b2e12f commit e21e941

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

web/app.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44

55
/** @var \Composer\Autoload\ClassLoader $loader */
66
$loader = require __DIR__.'/../app/autoload.php';
7-
include_once __DIR__.'/../var/bootstrap.php.cache';
7+
if (PHP_VERSION_ID < 70000) {
8+
include_once __DIR__.'/../var/bootstrap.php.cache';
9+
}
810

911
$kernel = new AppKernel('prod', false);
10-
$kernel->loadClassCache();
12+
if (PHP_VERSION_ID < 70000) {
13+
$kernel->loadClassCache();
14+
}
1115
//$kernel = new AppCache($kernel);
1216

1317
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter

web/app_dev.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
Debug::enable();
2424

2525
$kernel = new AppKernel('dev', true);
26-
$kernel->loadClassCache();
26+
if (PHP_VERSION_ID < 70000) {
27+
$kernel->loadClassCache();
28+
}
2729
$request = Request::createFromGlobals();
2830
$response = $kernel->handle($request);
2931
$response->send();

0 commit comments

Comments
 (0)