|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * File containing the EzPublishKernel class. |
| 4 | + * |
| 5 | + * @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved. |
| 6 | + * @license http://ez.no/eZPublish/Licenses/eZ-Trial-and-Test-License-Agreement-eZ-TTL-v2.0 eZ Trial and Test License Agreement Version 2.0 |
| 7 | + * @version 5.1.0-beta1 |
| 8 | + */ |
| 9 | + |
| 10 | +use eZ\Bundle\EzPublishCoreBundle\EzPublishCoreBundle; |
| 11 | +use Egulias\ListenersDebugCommandBundle\EguliasListenersDebugCommandBundle; |
| 12 | +use eZ\Bundle\EzPublishLegacyBundle\EzPublishLegacyBundle; |
| 13 | +use eZ\Bundle\EzPublishRestBundle\EzPublishRestBundle; |
| 14 | +use EzSystems\DemoBundle\EzSystemsDemoBundle; |
| 15 | +use Symfony\Component\HttpKernel\Kernel; |
| 16 | +use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
| 17 | +use Symfony\Bundle\SecurityBundle\SecurityBundle; |
| 18 | +use Symfony\Bundle\TwigBundle\TwigBundle; |
| 19 | +use Symfony\Bundle\MonologBundle\MonologBundle; |
| 20 | +use Symfony\Bundle\AsseticBundle\AsseticBundle; |
| 21 | +use Symfony\Bundle\WebProfilerBundle\WebProfilerBundle; |
| 22 | +use Symfony\Component\Config\Loader\LoaderInterface; |
| 23 | +use Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle; |
| 24 | +use Tedivm\StashBundle\TedivmStashBundle; |
| 25 | + |
| 26 | +class EzPublishKernel extends Kernel |
| 27 | +{ |
| 28 | + /** |
| 29 | + * Returns an array of bundles to registers. |
| 30 | + * |
| 31 | + * @return array An array of bundle instances. |
| 32 | + * |
| 33 | + * @api |
| 34 | + */ |
| 35 | + public function registerBundles() |
| 36 | + { |
| 37 | + $bundles = array( |
| 38 | + new FrameworkBundle(), |
| 39 | + new SecurityBundle(), |
| 40 | + new TwigBundle(), |
| 41 | + new MonologBundle(), |
| 42 | + new AsseticBundle(), |
| 43 | + new SensioGeneratorBundle(), |
| 44 | + new TedivmStashBundle(), |
| 45 | + new EzPublishCoreBundle(), |
| 46 | + new EzPublishLegacyBundle(), |
| 47 | + new EzSystemsDemoBundle(), |
| 48 | + new EzPublishRestBundle(), |
| 49 | + ); |
| 50 | + |
| 51 | + if ( $this->getEnvironment() === 'dev' || |
| 52 | + $this->getEnvironment() === 'priv' |
| 53 | + ) |
| 54 | + { |
| 55 | + $bundles[] = new WebProfilerBundle(); |
| 56 | + $bundles[] = new EguliasListenersDebugCommandBundle(); |
| 57 | + } |
| 58 | + |
| 59 | + return $bundles; |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Loads the container configuration |
| 64 | + * |
| 65 | + * @param LoaderInterface $loader A LoaderInterface instance |
| 66 | + * |
| 67 | + * @api |
| 68 | + */ |
| 69 | + public function registerContainerConfiguration( LoaderInterface $loader ) |
| 70 | + { |
| 71 | + $loader->load( __DIR__ . '/config/config_' . $this->getEnvironment() . '.yml' ); |
| 72 | + try |
| 73 | + { |
| 74 | + $loader->load( __DIR__ . '/config/ezpublish_' . $this->getEnvironment() . '.yml' ); |
| 75 | + } |
| 76 | + catch ( \InvalidArgumentException $e ) |
| 77 | + { |
| 78 | + $loader->load( __DIR__ . '/config/ezpublish_setup.yml' ); |
| 79 | + } |
| 80 | + } |
| 81 | +} |
0 commit comments