Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace SymfonyComponentHttpKernel;
- ...
- /**
- * The Kernel is the heart of the Symfony system.
- *
- * It manages an environment made of bundles.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
- abstract class Kernel implements KernelInterface, TerminableInterface
- {
- ...
- /**
- * Initializes the service container.
- *
- * The cached version of the service container is used when fresh, otherwise the
- * container is built.
- */
- protected function initializeContainer()
- {
- $class = $this->getContainerClass();
- // !!!!!! cache config object construction
- $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
- $fresh = true;
- if (!$cache->isFresh()) {
- $container = $this->buildContainer();
- $container->compile();
- $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
- $fresh = false;
- }
- require_once $cache->getPath();
- $this->container = new $class();
- $this->container->set('kernel', $this);
- if (!$fresh && $this->container->has('cache_warmer')) {
- $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
- }
- }
- }
- -home
- --symfony_app
- --custom_cache_directory
- public function getCacheDir()
- {
- return dirname(__DIR__).'/../custom_cache_directory/cache/'.$this->getEnvironment();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement