[HttpKernel] Dont reset start time when not needed

This commit is contained in:
Nicolas Grekas 2018-05-25 17:06:28 +02:00
parent bf20260025
commit 9de5014b27

View File

@ -102,20 +102,22 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
public function boot()
{
if ($this->debug) {
$this->startTime = microtime(true);
}
if (true === $this->booted) {
if (!$this->requestStackSize && $this->resetServices) {
if ($this->container->has('services_resetter')) {
$this->container->get('services_resetter')->reset();
}
$this->resetServices = false;
if ($this->debug) {
$this->startTime = microtime(true);
}
}
return;
}
if ($this->debug) {
$this->startTime = microtime(true);
}
if ($this->debug && !isset($_ENV['SHELL_VERBOSITY']) && !isset($_SERVER['SHELL_VERBOSITY'])) {
putenv('SHELL_VERBOSITY=3');
$_ENV['SHELL_VERBOSITY'] = 3;