Esempio n. 1
0
 public function aclLoad(array $configs, ContainerBuilder $container)
 {
     $processor = new Processor();
     $config = $processor->process($this->configuration->getAclConfigTree(), $configs);
     $loader = new XmlFileLoader($container, array(__DIR__ . '/../Resources/config', __DIR__ . '/Resources/config'));
     $loader->load('security_acl.xml');
     if (isset($config['connection'])) {
         $container->setAlias('security.acl.dbal.connection', sprintf('doctrine.dbal.%s_connection', $config['connection']));
     }
     if (isset($config['cache'])) {
         $container->setAlias('security.acl.cache', sprintf('security.acl.cache.%s', $config['cache']));
     }
 }
Esempio n. 2
0
 /**
  * Responds to the app.config configuration parameter.
  *
  * @param array            $configs
  * @param ContainerBuilder $container
  */
 public function configLoad(array $configs, ContainerBuilder $container)
 {
     $loader = new XmlFileLoader($container, __DIR__ . '/../Resources/config');
     $loader->load('web.xml');
     $loader->load('form.xml');
     $loader->load('services.xml');
     // A translator must always be registered (as support is included by
     // default in the Form component). If disabled, an identity translator
     // will be used and everything will still work as expected.
     $loader->load('translation.xml');
     if ($container->getParameter('kernel.debug')) {
         $loader->load('debug.xml');
         $container->setDefinition('event_dispatcher', $container->findDefinition('debug.event_dispatcher'));
         $container->setAlias('debug.event_dispatcher', 'event_dispatcher');
     }
     $processor = new Processor();
     $configuration = new Configuration();
     $config = $processor->process($configuration->getConfigTree($container->getParameter('kernel.debug')), $configs);
     $container->setParameter('kernel.cache_warmup', $config['cache_warmer']);
     if (isset($config['charset'])) {
         $container->setParameter('kernel.charset', $config['charset']);
     }
     if (isset($config['document_root'])) {
         $container->setParameter('document_root', $config['document_root']);
     }
     if (isset($config['error_handler'])) {
         if (false === $config['error_handler']) {
             $container->getDefinition('error_handler')->setMethodCalls(array());
         } else {
             $container->getDefinition('error_handler')->addMethodCall('register', array());
             $container->setParameter('error_handler.level', $config['error_handler']);
         }
     }
     if (isset($config['exception_controller'])) {
         $container->setParameter('exception_listener.controller', $config['exception_controller']);
     }
     if (isset($config['ide'])) {
         $patterns = array('textmate' => 'txmt://open?url=file://%%f&line=%%l', 'macvim' => 'mvim://open?url=file://%%f&line=%%l');
         $pattern = isset($patterns[$config['ide']]) ? $patterns[$config['ide']] : $config['ide'];
         $container->setParameter('debug.file_link_format', $pattern);
     }
     if (isset($config['test']) && $config['test']) {
         $loader->load('test.xml');
         $config['session']['storage_id'] = 'array';
     }
     if (isset($config['csrf_protection'])) {
         $this->registerCsrfProtectionConfiguration($config['csrf_protection'], $container);
     }
     if (isset($config['esi'])) {
         $this->registerEsiConfiguration($config['esi'], $loader);
     }
     if (isset($config['profiler'])) {
         $this->registerProfilerConfiguration($config['profiler'], $container, $loader);
     }
     if (isset($config['router'])) {
         $this->registerRouterConfiguration($config['router'], $container, $loader);
     }
     if (isset($config['session'])) {
         $this->registerSessionConfiguration($config['session'], $container, $loader);
     }
     if (isset($config['templating'])) {
         $this->registerTemplatingConfiguration($config['templating'], $container, $loader);
     }
     if (isset($config['translator'])) {
         $this->registerTranslatorConfiguration($config['translator'], $container);
     }
     if (isset($config['validation'])) {
         $this->registerValidationConfiguration($config['validation'], $container, $loader);
     }
     $this->addClassesToCompile(array('Symfony\\Component\\HttpFoundation\\ParameterBag', 'Symfony\\Component\\HttpFoundation\\HeaderBag', 'Symfony\\Component\\HttpFoundation\\Request', 'Symfony\\Component\\HttpFoundation\\Response', 'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag', 'Symfony\\Component\\HttpKernel\\HttpKernel', 'Symfony\\Component\\HttpKernel\\ResponseListener', 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface', 'Symfony\\Bundle\\FrameworkBundle\\RequestListener', 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', 'Symfony\\Component\\EventDispatcher\\EventInterface', 'Symfony\\Component\\EventDispatcher\\Event', 'Symfony\\Component\\EventDispatcher\\EventDispatcherInterface', 'Symfony\\Component\\EventDispatcher\\EventDispatcher', 'Symfony\\Bundle\\FrameworkBundle\\EventDispatcher'));
 }