1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Hautelook\AliceBundle package. |
5
|
|
|
* |
6
|
|
|
* (c) Baldur Rensch <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Hautelook\AliceBundle\Functional; |
13
|
|
|
|
14
|
|
|
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; |
15
|
|
|
use Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle; |
16
|
|
|
use Hautelook\AliceBundle\HautelookAliceBundle; |
17
|
|
|
use Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle; |
18
|
|
|
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
19
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
20
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
21
|
|
|
use Symfony\Component\DependencyInjection\Compiler\PassConfig; |
22
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
23
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
24
|
|
|
|
25
|
|
|
class AppKernel extends Kernel |
26
|
|
|
{ |
27
|
|
|
/** |
28
|
|
|
* @inheritdoc |
29
|
|
|
*/ |
30
|
|
|
public function registerBundles() |
31
|
|
|
{ |
32
|
|
|
return [ |
33
|
|
|
new FrameworkBundle(), |
34
|
|
|
new NelmioAliceBundle(), |
35
|
|
|
new FidryAliceDataFixturesBundle(), |
36
|
|
|
new DoctrineBundle(), |
37
|
|
|
new HautelookAliceBundle(), |
38
|
|
|
]; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @inheritdoc |
43
|
|
|
*/ |
44
|
|
|
public function registerContainerConfiguration(LoaderInterface $loader) |
45
|
|
|
{ |
46
|
|
|
$loader->load(__DIR__.'/config/config.yml'); |
47
|
|
|
$loader->load(__DIR__.'/config/doctrine.yml'); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @inheritdoc |
52
|
|
|
*/ |
53
|
|
|
public function build(ContainerBuilder $container) |
54
|
|
|
{ |
55
|
|
|
parent::build($container); |
56
|
|
|
|
57
|
|
|
if ('public' !== $this->getEnvironment()) { |
58
|
|
|
return; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
$container->addCompilerPass(new class() implements CompilerPassInterface { |
62
|
|
|
public function process(ContainerBuilder $container) |
63
|
|
|
{ |
64
|
|
|
foreach ($container->getDefinitions() as $id => $definition) { |
65
|
|
|
$definition->setPublic(true); |
66
|
|
|
} |
67
|
|
|
foreach ($container->getAliases() as $id => $definition) { |
68
|
|
|
$definition->setPublic(true); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
}, PassConfig::TYPE_OPTIMIZE); |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|