8000 [HttpKernel] enabling cache-reloading when cache file is rebuilt by stampycode · Pull Request #20065 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] enabling cache-reloading when cache file is rebuilt #20065

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

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
[HttpKernel] load cached class fails when desired class is versioned
  • Loading branch information
stampy committed Sep 28, 2016
commit d20686c4b553155d3f066bbb9326adcb59e7611d
3 changes: 2 additions & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ protected function initializeContainer()
$class = $this->getContainerClass();
$cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
$fresh = true;
$unversionedClass = $class;
if (!$cache->isFresh()) {
$container = $this->buildContainer();
$container->compile();
Expand All @@ -497,7 +498,7 @@ protected function initializeContainer()
if(!class_exists($class)) {
//the cache file loaded has a different classVersion than we expected, so we need to find the loaded class.
foreach (array_reverse(get_declared_classes()) as $declaredClass) {
if (rtrim($declaredClass, '0123456789') === $class) {
if (rtrim($declaredClass, '0123456789') === $unversionedClass) {
class_alias($declaredClass, $class);
break;
}
Expand Down
0