|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
|
4
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
|
5
|
|
|
|
|
6
|
|
|
/** |
|
7
|
|
|
* Class AppKernel |
|
8
|
|
|
*/ |
|
9
|
|
|
class AppKernel extends Kernel |
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* {@inheritdoc} |
|
13
|
|
|
*/ |
|
14
|
|
|
public function registerBundles() |
|
15
|
|
|
{ |
|
16
|
|
|
$bundles = [ |
|
17
|
|
|
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
|
18
|
|
|
new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
|
19
|
|
|
new Symfony\Bundle\TwigBundle\TwigBundle(), |
|
20
|
|
|
new Symfony\Bundle\MonologBundle\MonologBundle(), |
|
21
|
|
|
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), |
|
22
|
|
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
|
23
|
|
|
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), |
|
24
|
|
|
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), |
|
25
|
|
|
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
|
26
|
|
|
new Dunglas\ActionBundle\DunglasActionBundle(), |
|
27
|
|
|
new ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle(), |
|
28
|
|
|
new Nelmio\CorsBundle\NelmioCorsBundle(), |
|
29
|
|
|
new Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle(), |
|
30
|
|
|
new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(), |
|
31
|
|
|
// new Dunglas\DoctrineJsonOdm\Bundle\DunglasDoctrineJsonOdmBundle(), |
|
32
|
|
|
new FOS\UserBundle\FOSUserBundle(), |
|
33
|
|
|
new Snc\RedisBundle\SncRedisBundle(), |
|
34
|
|
|
new Ds\Component\Api\Bridge\Symfony\Bundle\DsApiBundle(), |
|
35
|
|
|
new Ds\Component\Cache\Bridge\Symfony\Bundle\DsCacheBundle(), |
|
36
|
|
|
new Ds\Component\Config\Bridge\Symfony\Bundle\DsConfigBundle(), |
|
37
|
|
|
new Ds\Component\Discovery\Bridge\Symfony\Bundle\DsDiscoveryBundle(), |
|
38
|
|
|
new Ds\Component\Entity\Bridge\Symfony\Bundle\DsEntityBundle(), |
|
39
|
|
|
new Ds\Component\Health\Bridge\Symfony\Bundle\DsHealthBundle(), |
|
40
|
|
|
new Ds\Component\Locale\Bridge\Symfony\Bundle\DsLocaleBundle(), |
|
41
|
|
|
new Ds\Component\Log\Bridge\Symfony\Bundle\DsLogBundle(), |
|
42
|
|
|
new Ds\Component\Resolver\Bridge\Symfony\Bundle\DsResolverBundle(), |
|
43
|
|
|
new Ds\Component\Security\Bridge\Symfony\Bundle\DsSecurityBundle(), |
|
44
|
|
|
new Ds\Component\Session\Bridge\Symfony\Bundle\DsSessionBundle(), |
|
45
|
|
|
new Ds\Component\Statistic\Bridge\Symfony\Bundle\DsStatisticBundle(), |
|
46
|
|
|
new Ds\Component\Translation\Bridge\Symfony\Bundle\DsTranslationBundle(), |
|
47
|
|
|
new AppBundle\AppBundle(), |
|
48
|
|
|
]; |
|
49
|
|
|
|
|
50
|
|
|
if (in_array($this->getEnvironment(), ['prod'], true)) { |
|
51
|
|
|
$bundles[] = new Ds\Component\Exception\Bridge\Symfony\Bundle\DsExceptionBundle(); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { |
|
55
|
|
|
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
|
56
|
|
|
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
|
57
|
|
|
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); |
|
58
|
|
|
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); |
|
59
|
|
|
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); |
|
60
|
|
|
$bundles[] = new Ds\Component\Debug\Bridge\Symfony\Bundle\DsDebugBundle(); |
|
61
|
|
|
$bundles[] = new Ds\Component\Identity\Bridge\Symfony\TestBundle\DsIdentityTestBundle(); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
return $bundles; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* {@inheritdoc} |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getRootDir() |
|
71
|
|
|
{ |
|
72
|
|
|
return __DIR__; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* {@inheritdoc} |
|
77
|
|
|
*/ |
|
78
|
|
|
public function getCacheDir() |
|
79
|
|
|
{ |
|
80
|
|
|
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* {@inheritdoc} |
|
85
|
|
|
*/ |
|
86
|
|
|
public function getLogDir() |
|
87
|
|
|
{ |
|
88
|
|
|
return dirname(__DIR__).'/var/logs'; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* {@inheritdoc} |
|
93
|
|
|
*/ |
|
94
|
|
|
public function registerContainerConfiguration(LoaderInterface $loader) |
|
95
|
|
|
{ |
|
96
|
|
|
$loader->load($this->getRootDir().'/config/'.$this->getEnvironment().'/config.yml'); |
|
97
|
|
|
} |
|
98
|
|
|
} |
|
99
|
|
|
|