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

Skip to content

[DI] Allow dumping the container in one file instead of many files #32119

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 2 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
Simplified code
  • Loading branch information
lyrixx committed Jul 16, 2019
commit 45bf554231ec72fb7c751e8f464bc1094d975595
12 changes: 4 additions & 8 deletions src/Symfony/Component/HttpKernel/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,10 @@ protected function initializeContainer()
$cacheDir = $this->warmupDir ?: $this->getCacheDir();
$cache = new ConfigCache($cacheDir.'/'.$class.'.php', $this->debug);
$oldContainer = null;
if ($fresh = $cache->isFresh()) {
if ($cache->isFresh()) {
// Silence E_WARNING to ignore "include" failures - don't use "@" to prevent silencing fatal errors
$errorLevel = error_reporting(\E_ALL ^ \E_WARNING);
$fresh = $oldContainer = false;
$oldContainer = false;
try {
if (!$asFiles) {
require_once $cache->getPath();
Expand All @@ -498,19 +498,15 @@ protected function initializeContainer()
}
if (file_exists($cache->getPath()) && \is_object($this->container = include $cache->getPath())) {
$this->container->set('kernel', $this);
$oldContainer = $this->container;
$fresh = true;

return;
}
} catch (\Throwable $e) {
} finally {
error_reporting($errorLevel);
}
}

if ($fresh) {
return;
}

if ($this->debug) {
$collectedLogs = [];
$previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');
Expand Down