8000 [HttpKernel] Remove old container files · symfony/symfony@ec67f4e · GitHub
[go: up one dir, main page]

Skip to content

Commit ec67f4e

Browse files
[HttpKernel] Remove old container files
1 parent eeaea83 commit ec67f4e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,16 @@ protected function initializeContainer()
584584
file_put_contents($this->getCacheDir().'/'.$class.'Compiler.log', null !== $container ? implode("\n", $container->getCompiler()->getLog()) : '');
585585
}
586586
}
587+
$oldContainer = file_exists($cache->getPath()) ? @include $cache->getPath() : false;
588+
587589
$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
588590

591+
if ($oldContainer) {
592+
$oldContainer = new \ReflectionClass($oldContainer);
593+
$oldContainer = dirname($oldContainer->getFileName());
594+
(new Filesystem())->remove($oldContainer);
595+
}
596+
589597
$fresh = false;
590598
}
591599

0 commit comments

Comments
 (0)
0