File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/Symfony/Component/HttpKernel Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -644,19 +644,18 @@ protected function initializeContainer()
644
644
return ;
645
645
}
646
646
647
- if ($ oldContainer ) {
647
+ if ($ oldContainer && get_class ( $ this -> container ) !== $ oldContainer -> name ) {
648
648
// Because concurrent requests might still be using them,
649
649
// old container files are not removed immediately,
650
650
// but on a next dump of the container.
651
651
$ oldContainerDir = dirname ($ oldContainer ->getFileName ());
652
652
foreach (glob (dirname ($ oldContainerDir ).'/*.legacyContainer ' ) as $ legacyContainer ) {
653
- if (@unlink ($ legacyContainer )) {
653
+ if ($ oldContainerDir . ' .legacyContainer ' !== $ legacyContainer && @unlink ($ legacyContainer )) {
654
654
(new Filesystem ())->remove (substr ($ legacyContainer , 0 , -16 ));
655
655
}
656
656
}
657
- if (get_class ($ this ->container ) !== $ oldContainer ->name ) {
658
- touch ($ oldContainerDir .'.legacyContainer ' );
659
- }
657
+
658
+ touch ($ oldContainerDir .'.legacyContainer ' );
660
659
}
661
660
662
661
if ($ this ->container ->has ('cache_warmer ' )) {
You can’t perform that action at this time.
0 commit comments