Explorar o código

merged branch mvrhov/cache_warmup_exception (PR #2445)

Commits
-------

6b872cf Check if cache_warmer service is available before doing the actual cache warmup

Discussion
----------

fix cache warump exception when service is not available

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A

fixes [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
  You have requested a non-existent service "cache_warmer". in console when FrameworkBundle is removed from kernel.
Fabien Potencier %!s(int64=13) %!d(string=hai) anos
pai
achega
76148d0da6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Symfony/Component/HttpKernel/Kernel.php

+ 1 - 1
src/Symfony/Component/HttpKernel/Kernel.php

@@ -553,7 +553,7 @@ abstract class Kernel implements KernelInterface
         $this->container = new $class();
         $this->container->set('kernel', $this);
 
-        if (!$fresh) {
+        if (!$fresh && $this->container->has('cache_warmer')) {
             $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
         }
     }