12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace Symfony\Bundle\FrameworkBundle;
- use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddSecurityVotersPass;
- use Symfony\Component\DependencyInjection\ContainerBuilder;
- use Symfony\Component\HttpKernel\Bundle\Bundle;
- use Symfony\Component\Form\FormConfiguration;
- /*
- * This file is part of the Symfony framework.
- *
- * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- /**
- * Bundle.
- *
- * @author Fabien Potencier <fabien.potencier@symfony-project.com>
- */
- class FrameworkBundle extends Bundle
- {
- /**
- * Boots the Bundle.
- */
- public function boot()
- {
- if ($this->container->has('error_handler')) {
- $this->container->get('error_handler');
- }
- if ($this->container->hasParameter('csrf_secret')) {
- FormConfiguration::setDefaultCsrfSecret($this->container->getParameter('csrf_secret'));
- FormConfiguration::enableDefaultCsrfProtection();
- }
- }
- public function registerExtensions(ContainerBuilder $container)
- {
- parent::registerExtensions($container);
- $container->addCompilerPass(new AddSecurityVotersPass());
- }
- }
|