Skip to content

Commit

Permalink
minor #29645 Allow running PHPUnit with "xdebug.scream" ON (nico-incu…
Browse files Browse the repository at this point in the history
…biq)

This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #29645).

Discussion
----------

Allow running PHPUnit with "xdebug.scream" ON

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |  <!-- required for new features -->

Since #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

Commits
-------

7a7165e Allow running PHPUnit with "xdebug.scream" ON
  • Loading branch information
nicolas-grekas committed Dec 19, 2018
2 parents 7fa13be + 7a7165e commit c0cf123
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -862,7 +862,10 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container
$fs->dumpFile($dir.$file, $code);
@chmod($dir.$file, 0666 & ~umask());
}
@unlink(\dirname($dir.$file).'.legacy');
$legacyFile = \dirname($dir.$file).'.legacy';
if (file_exists($legacyFile)) {
@unlink($legacyFile);
}

$cache->write($rootCode, $container->getResources());
}
Expand Down

0 comments on commit c0cf123

Please sign in to comment.