Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.09 KB | None | 0 0
  1. <?php
  2.  
  3. use Symfony\Component\HttpKernel\Kernel;
  4. use Symfony\Component\Config\Loader\LoaderInterface;
  5. use Symfony\Component\ClassLoader\DebugUniversalClassLoader;
  6. use Symfony\Component\HttpKernel\Debug\ErrorHandler;
  7.  
  8. class AppKernel extends Kernel
  9. {
  10.     public function registerBundles()
  11.     {
  12.         $bundles = array(
  13.             new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
  14.             new Symfony\Bundle\SecurityBundle\SecurityBundle(),
  15.             new Symfony\Bundle\TwigBundle\TwigBundle(),
  16.             new Symfony\Bundle\MonologBundle\MonologBundle(),
  17.             new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
  18.             new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
  19.             new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
  20.             new Symfony\Bundle\AsseticBundle\AsseticBundle(),
  21.             new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
  22.             new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
  23.            
  24.             new FOS\UserBundle\FOSUserBundle(),
  25.             new VIVAFaune\ContactBundle\VIVAFauneContactBundle(),
  26.             new VIVAFaune\CompteBundle\VIVAFauneCompteBundle(),
  27.             new VIVAFaune\DictionnaireBundle\VIVAFauneDictionnaireBundle(),
  28.             new VIVAFaune\AnnuaireBundle\VIVAFauneAnnuaireBundle(),
  29.         );
  30.  
  31.         if (in_array($this->getEnvironment(), array('dev', 'test'))) {
  32.            
  33.             $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
  34.             $bundles[] = new Symfony\Bundle\WebConfiguratorBundle\SymfonyWebConfiguratorBundle();
  35.         }
  36.  
  37.         return $bundles;
  38.     }
  39.  
  40.     public function init()
  41.     {
  42.         if ($this->debug) {
  43.             ini_set('display_errors', 1);
  44.             error_reporting(-1);
  45.  
  46.             DebugUniversalClassLoader::enable();
  47.             ErrorHandler::register();
  48.         } else {
  49.             ini_set('display_errors', 0);
  50.         }
  51.     }
  52.  
  53.     public function registerContainerConfiguration(LoaderInterface $loader)
  54.     {
  55.         $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement