AppKernel.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Symfony\Component\Config\Loader\LoaderInterface;
  3. use Symfony\Component\Debug\ErrorHandler;
  4. use Symfony\Component\HttpKernel\Kernel;
  5. class AppKernel extends Kernel
  6. {
  7. public function registerBundles()
  8. {
  9. $bundles = array(
  10. new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
  11. new Symfony\Bundle\SecurityBundle\SecurityBundle(),
  12. new Symfony\Bundle\TwigBundle\TwigBundle(),
  13. new Symfony\Bundle\MonologBundle\MonologBundle(),
  14. new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
  15. new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
  16. new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
  17. new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
  18. new FOS\UserBundle\FOSUserBundle(),
  19. new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
  20. new Snc\RedisBundle\SncRedisBundle(),
  21. new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
  22. new Nelmio\SolariumBundle\NelmioSolariumBundle(),
  23. new Nelmio\SecurityBundle\NelmioSecurityBundle(),
  24. new Knp\Bundle\MenuBundle\KnpMenuBundle(),
  25. new Nelmio\CorsBundle\NelmioCorsBundle(),
  26. new Packagist\WebBundle\PackagistWebBundle(),
  27. );
  28. if (in_array($this->getEnvironment(), array('dev', 'test'))) {
  29. $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
  30. $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
  31. }
  32. return $bundles;
  33. }
  34. public function registerContainerConfiguration(LoaderInterface $loader)
  35. {
  36. $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
  37. }
  38. }