Skip to content

Commit

Permalink
bug #414 Fix error with class redeclaration: Do not load cache files …
Browse files Browse the repository at this point in the history
…on PHP 7 (bocharsky-bw)

This PR was merged into the master branch.

Discussion
----------

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

Fix #411

I think this error could be related to the symfony/symfony-standard#1030

Commits
-------

13da5dc Fix error with class redeclaration: Do not load cache files on PHP 7
  • Loading branch information
javiereguiluz committed Jan 2, 2017
2 parents 0bde7f7 + 13da5dc commit 949cc64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit 949cc64

Please sign in to comment.