Skip to content

Fix error with class redeclaration: Do not load cache files on PHP 7 #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions web/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
* @var Composer\Autoload\ClassLoader
*/
$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';
}

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

$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
if (PHP_VERSION_ID < 70000) {
$kernel->loadClassCache();
}

// When using the HTTP Cache to improve application performance, the application
// kernel is wrapped by the AppCache class to activate the built-in reverse proxy.
Expand Down
4 changes: 3 additions & 1 deletion web/app_dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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();
Expand Down