AppKernel.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Symfony\Component\HttpKernel\Kernel;
  4. use Symfony\Component\Config\Loader\LoaderInterface;
  5. /**
  6. * Class AppKernel
  7. */
  8. class AppKernel extends Kernel
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function registerBundles()
  14. {
  15. $bundles = array(
  16. new FOS\RestBundle\FOSRestBundle(),
  17. new JMS\SerializerBundle\JMSSerializerBundle($this),
  18. new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
  19. new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
  20. new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
  21. // Sylius
  22. new Sylius\Bundle\SettingsBundle\SyliusSettingsBundle(),
  23. //new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
  24. new Sylius\Bundle\FlowBundle\SyliusFlowBundle(),
  25. // Symfony standard edition
  26. new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
  27. new Symfony\Bundle\SecurityBundle\SecurityBundle(),
  28. new Symfony\Bundle\TwigBundle\TwigBundle(),
  29. new Symfony\Bundle\MonologBundle\MonologBundle(),
  30. new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
  31. new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
  32. new JMS\AopBundle\JMSAopBundle(),
  33. //new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
  34. new Symfony\Bundle\AsseticBundle\AsseticBundle(),
  35. // Doctrine
  36. new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
  37. new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
  38. // KNP HELPER BUNDLES
  39. new Knp\Bundle\MenuBundle\KnpMenuBundle(),
  40. new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
  41. new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
  42. // User
  43. new FOS\UserBundle\FOSUserBundle(),
  44. new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
  45. new Chamilo\UserBundle\ChamiloUserBundle(),
  46. // Page
  47. new Sonata\PageBundle\SonataPageBundle(),
  48. new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
  49. // NEWS
  50. new Sonata\NewsBundle\SonataNewsBundle(),
  51. new Application\Sonata\NewsBundle\ApplicationSonataNewsBundle(),
  52. // MEDIA
  53. new Sonata\MediaBundle\SonataMediaBundle(),
  54. new Application\Sonata\MediaBundle\ApplicationSonataMediaBundle(),
  55. // new Liip\ImagineBundle\LiipImagineBundle(),
  56. //new Presta\CMSMediaBundle\PrestaCMSMediaBundle(),
  57. new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
  58. new CoopTilleuls\Bundle\CKEditorSonataMediaBundle\CoopTilleulsCKEditorSonataMediaBundle(),
  59. new Sonata\AdminBundle\SonataAdminBundle(),
  60. new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
  61. // Disable this if you don't want the audit on entities
  62. new SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle(),
  63. // API
  64. new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
  65. // E-COMMERCE
  66. /*new Sonata\BasketBundle\SonataBasketBundle(),
  67. new Application\Sonata\BasketBundle\ApplicationSonataBasketBundle(),
  68. new Sonata\CustomerBundle\SonataCustomerBundle(),
  69. new Application\Sonata\CustomerBundle\ApplicationSonataCustomerBundle(),
  70. new Sonata\DeliveryBundle\SonataDeliveryBundle(),
  71. new Application\Sonata\DeliveryBundle\ApplicationSonataDeliveryBundle(),
  72. new Sonata\InvoiceBundle\SonataInvoiceBundle(),
  73. new Application\Sonata\InvoiceBundle\ApplicationSonataInvoiceBundle(),
  74. new Sonata\OrderBundle\SonataOrderBundle(),
  75. new Application\Sonata\OrderBundle\ApplicationSonataOrderBundle(),
  76. new Sonata\PaymentBundle\SonataPaymentBundle(),
  77. new Application\Sonata\PaymentBundle\ApplicationSonataPaymentBundle(),
  78. new Sonata\ProductBundle\SonataProductBundle(),
  79. new Application\Sonata\ProductBundle\ApplicationSonataProductBundle(),
  80. new Sonata\PriceBundle\SonataPriceBundle(),
  81. */
  82. new FOS\CommentBundle\FOSCommentBundle(),
  83. new Sonata\CommentBundle\SonataCommentBundle(),
  84. new Application\Sonata\CommentBundle\ApplicationSonataCommentBundle(),
  85. // SONATA CORE & HELPER BUNDLES
  86. new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
  87. new Sonata\CoreBundle\SonataCoreBundle(),
  88. new Sonata\IntlBundle\SonataIntlBundle(),
  89. new Sonata\FormatterBundle\SonataFormatterBundle(),
  90. new Sonata\CacheBundle\SonataCacheBundle(),
  91. new Sonata\BlockBundle\SonataBlockBundle(),
  92. new Sonata\SeoBundle\SonataSeoBundle(),
  93. new Sonata\ClassificationBundle\SonataClassificationBundle(),
  94. new Sonata\NotificationBundle\SonataNotificationBundle(),
  95. new Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle(),
  96. new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),
  97. new Application\Sonata\SeoBundle\ApplicationSonataSeoBundle(),
  98. new Sonata\DatagridBundle\SonataDatagridBundle(),
  99. // Search Integration
  100. //new FOS\ElasticaBundle\FOSElasticaBundle(),
  101. // CMF Integration
  102. new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
  103. // DEMO and QA - Can be deleted
  104. //new Sonata\Bundle\DemoBundle\SonataDemoBundle(),
  105. //new Sonata\Bundle\QABundle\SonataQABundle(),
  106. // Disable this if you don't want the timeline in the admin
  107. new Spy\TimelineBundle\SpyTimelineBundle(),
  108. new Sonata\TimelineBundle\SonataTimelineBundle(),
  109. new Application\Sonata\TimelineBundle\ApplicationSonataTimelineBundle(), // easy extends integration
  110. new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
  111. new Application\Sonata\AdminBundle\ApplicationSonataAdminBundle(),
  112. new FOS\AdvancedEncoderBundle\FOSAdvancedEncoderBundle(),
  113. //new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
  114. new FOS\MessageBundle\FOSMessageBundle(),
  115. // Chamilo
  116. new Chamilo\InstallerBundle\ChamiloInstallerBundle(),
  117. new Chamilo\CoreBundle\ChamiloCoreBundle(),
  118. new Chamilo\CourseBundle\ChamiloCourseBundle(),
  119. new Chamilo\MessageBundle\ChamiloMessageBundle(),
  120. new Chamilo\SettingsBundle\ChamiloSettingsBundle(),
  121. new Chamilo\ThemeBundle\ChamiloThemeBundle(),
  122. // Chamilo course tool
  123. new Chamilo\NotebookBundle\ChamiloNotebookBundle(),
  124. new APY\DataGridBundle\APYDataGridBundle(),
  125. new JMS\TranslationBundle\JMSTranslationBundle(),
  126. new Liip\ThemeBundle\LiipThemeBundle(),
  127. //new FOS\RestBundle\FOSRestBundle(),
  128. //new JMS\SerializerBundle\JMSSerializerBundle($this),
  129. new Sp\BowerBundle\SpBowerBundle(),
  130. new Oro\Bundle\MigrationBundle\OroMigrationBundle(),
  131. new Thrace\DataGridBundle\ThraceDataGridBundle(),
  132. new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
  133. //new Vich\UploaderBundle\VichUploaderBundle(),
  134. );
  135. if (in_array($this->getEnvironment(), array('dev', 'test'))) {
  136. //$bundles[] = new Jjanvier\Bundle\CrowdinBundle\JjanvierCrowdinBundle(),
  137. $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
  138. $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
  139. $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
  140. $bundles[] = new Bazinga\Bundle\FakerBundle\BazingaFakerBundle();
  141. $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
  142. $bundles[] = new Elao\WebProfilerExtraBundle\WebProfilerExtraBundle();
  143. $bundles[] = new Jns\Bundle\XhprofBundle\JnsXhprofBundle();
  144. $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
  145. }
  146. return $bundles;
  147. }
  148. public function registerContainerConfiguration(LoaderInterface $loader)
  149. {
  150. $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
  151. }
  152. /*public function getCacheDir()
  153. {
  154. return dirname(dirname(__DIR__)).'/cache/'.$this->environment;
  155. }
  156. public function getLogDir()
  157. {
  158. return dirname(dirname(__DIR__)).'/log/';
  159. }*/
  160. /*public function getLogDir()
  161. {
  162. return $this->rootDir.'/../logs/'.$this->environment.'/logs/';
  163. }
  164. public function getCacheDir()
  165. {
  166. return $this->rootDir.'/../data/temp/'.$this->environment.'/cache/';
  167. }*/
  168. // Custom paths
  169. /**
  170. * Returns the real root path
  171. * @return string
  172. */
  173. public function getRealRootDir()
  174. {
  175. return realpath($this->rootDir.'/../').'/';
  176. }
  177. /**
  178. * Returns the data path
  179. * @return string
  180. */
  181. public function getDataDir()
  182. {
  183. return $this->getRealRootDir().'data/';
  184. }
  185. }