Browse Source

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

Miha Vrhovnik 13 năm trước cách đây
mục cha
commit
6b872cfa40
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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'));
         }
     }