AppKernel.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. use Symfony\Component\HttpKernel\Kernel;
  3. use Symfony\Component\Config\Loader\LoaderInterface;
  4. class AppKernel extends Kernel
  5. {
  6. public function registerBundles()
  7. {
  8. $bundles = [
  9. new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
  10. new Symfony\Bundle\SecurityBundle\SecurityBundle(),
  11. new Symfony\Bundle\TwigBundle\TwigBundle(),
  12. new Symfony\Bundle\MonologBundle\MonologBundle(),
  13. new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
  14. new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
  15. new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
  16. new Sonata\CoreBundle\SonataCoreBundle(),
  17. new Sonata\BlockBundle\SonataBlockBundle(),
  18. new Knp\Bundle\MenuBundle\KnpMenuBundle(),
  19. new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
  20. new Sonata\AdminBundle\SonataAdminBundle(),
  21. new FTTHBundle\FTTHBundle(),
  22. new WebserviceBundle\WebserviceBundle(),
  23. new Voryx\RESTGeneratorBundle\VoryxRESTGeneratorBundle(),
  24. new FOS\RestBundle\FOSRestBundle(),
  25. new JMS\SerializerBundle\JMSSerializerBundle($this),
  26. new Nelmio\CorsBundle\NelmioCorsBundle(),
  27. new Base\AdminBundle\BaseAdminBundle(),
  28. new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
  29. new WorkflowBundle\WorkflowBundle(),
  30. new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
  31. new Base\OAuthClientBundle\BaseOAuthClientBundle(),
  32. new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
  33. ];
  34. if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
  35. $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
  36. $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
  37. $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
  38. $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
  39. }
  40. return $bundles;
  41. }
  42. public function getRootDir()
  43. {
  44. return __DIR__;
  45. }
  46. public function getCacheDir()
  47. {
  48. return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
  49. }
  50. public function getLogDir()
  51. {
  52. return dirname(__DIR__).'/var/logs';
  53. }
  54. public function registerContainerConfiguration(LoaderInterface $loader)
  55. {
  56. $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
  57. }
  58. }