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; }
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; }