build() публичный Метод

public build ( ContainerBuilder $container )
$container Symfony\Component\DependencyInjection\ContainerBuilder
 protected function getRawContainer()
 {
     $container = new ContainerBuilder();
     $security = new SecurityExtension();
     $container->registerExtension($security);
     $bundle = new SecurityBundle();
     $bundle->build($container);
     $container->getCompilerPassConfig()->setOptimizationPasses(array());
     $container->getCompilerPassConfig()->setRemovingPasses(array());
     return $container;
 }
Пример #2
0
 protected function getContainer($file)
 {
     if (isset(self::$containerCache[$file])) {
         return self::$containerCache[$file];
     }
     $container = new ContainerBuilder();
     $security = new SecurityExtension();
     $container->registerExtension($security);
     $bundle = new SecurityBundle();
     $bundle->build($container);
     // Attach all default factories
     $this->loadFromFile($container, $file);
     $container->getCompilerPassConfig()->setOptimizationPasses(array());
     $container->getCompilerPassConfig()->setRemovingPasses(array());
     $container->compile();
     return self::$containerCache[$file] = $container;
 }