src/DependencyInjection/ContainerInitializer/CachedInitializer.php
public function initializeContainer(Application $application, array $extensions = array(), array $compilerPasses = array())
    {
        $class = $this->getContainerClass($application);
        $cache = new ConfigCache($this->cacheDir.'/'.$class.'.php', $application->isDebug());
        if (!$cache->isFresh()) {
            $container = $this->wrappedInitializer->initializeContainer($application, $extensions, $compilerPasses);

            $this->dumpContainer($cache, $container, $class, 'Container');
        }

        require_once $cache;

        return new $class();
    }
public function initializeContainer(Application $application, array $extensions = array(), array $compilerPasses = array())
    {
        $class = $this->getContainerClass($application);
        $cache = new ConfigCache($this->cacheDir.'/'.$class.'.php', $application->isDebug());
        if (!$cache->isFresh()) {
            $container = $this->wrappedInitializer->initializeContainer($application, $extensions, $compilerPasses);

            $this->dumpContainer($cache, $container, $class, 'Container');
        }

        require_once $cache;

        return new $class();
    }
public function initializeContainer ( Application $ application , array $ extensions = array ( ) , array $ compilerPasses = array ( ) ) { $ class = $ this -> getContainerClass ( $ application ) ; $ cache = new ConfigCache ( $ this -> cacheDir . '/' . $ class . '.php' , $ application -> isDebug ( ) ) ; if ( ! $ cache -> isFresh ( ) ) { $ container = $ this -> wrappedInitializer -> initializeContainer ( $ application , $ extensions , $ compilerPasses ) ; $ this -> dumpContainer ( $ cache , $ container , $ class , 'Container' ) ; } require_once $ cache ; return new $ class ( ) ; }
Returns a fully built, ready to use Container

@param Application                   $application
@param array|ExtensionInterface[]    $extensions
@param array|CompilerPassInterface[] $compilerPasses

@return ContainerInterface
Returns a fully built ready to use Container