Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6145fe4

Browse files
nico-incubiqnicolas-grekas
authored andcommitted
Allow running PHPUnit with "xdebug.scream" ON
Since symfony/symfony#25733 the Kernel attempts to unlink the legacy container while being built. This throws an error if the file did not exist, for example on a clean install, on the build, which is then silenced. That's fine on production systems, but on our build we have enabled "xdebug.scream" in order to visualise every errors, which basically un-silences the errors. I believe there should not be a need to silence anything on a usual, clean usage of the system. Making this `unlink` conditional fixes it. Could you please approve and merge this PR? Thanks
1 parent 50fe33a commit 6145fe4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Kernel.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,10 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container
862862
$fs->dumpFile($dir.$file, $code);
863863
@chmod($dir.$file, 0666 & ~umask());
864864
}
865-
@unlink(\dirname($dir.$file).'.legacy');
865+
$legacyFile = \dirname($dir.$file).'.legacy';
866+
if (file_exists($legacyFile)) {
867+
@unlink($legacyFile);
868+
}
866869

867870
$cache->write($rootCode, $container->getResources());
868871
}

0 commit comments

Comments
 (0)