dumpContainer() protected méthode

Dumps the service container to PHP code in the cache.
protected dumpContainer ( Symfony\Component\Config\ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass )
$cache Symfony\Component\Config\ConfigCache The config cache
$container Symfony\Component\DependencyInjection\ContainerBuilder The service container
$class string The name of the class to generate
$baseClass string The name of the container's base class
 protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass)
 {
     parent::dumpContainer($cache, $container, $class, $baseClass);
     $data = array();
     foreach ($this->zikulaBundles as $type => $bundles) {
         /* @var AbstractModule $bundle */
         foreach ($bundles as $bundle) {
             $data[$bundle->getName()] = $bundle->getServiceIds();
         }
     }
     $cache = new \Symfony\Component\Config\ConfigCache($this->getCacheDir() . '/' . $class . '.modules', $this->debug);
     $cache->write(serialize($data));
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass)
 {
     foreach ($this->getConfiguration()->getResources() as $resource) {
         $container->addResource($resource);
     }
     parent::dumpContainer($cache, $container, $class, $baseClass);
 }