1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
4
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
5
|
|
|
|
6
|
|
|
class AppKernel extends Kernel |
7
|
|
|
{ |
8
|
20 |
|
public function registerBundles() |
9
|
|
|
{ |
10
|
|
|
$bundles = array( |
11
|
20 |
|
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
12
|
20 |
|
new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
13
|
20 |
|
new Symfony\Bundle\TwigBundle\TwigBundle(), |
14
|
20 |
|
new Symfony\Bundle\MonologBundle\MonologBundle(), |
15
|
20 |
|
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), |
16
|
20 |
|
new Symfony\Bundle\AsseticBundle\AsseticBundle(), |
17
|
20 |
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
18
|
20 |
|
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
19
|
|
|
// Additional bundles |
20
|
20 |
|
new FOS\RestBundle\FOSRestBundle(), |
21
|
|
|
//new JMS\SerializerBundle\JMSSerializerBundle(), |
|
|
|
|
22
|
20 |
|
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), |
23
|
20 |
|
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), |
24
|
20 |
|
new \Tbbc\MoneyBundle\TbbcMoneyBundle(), |
25
|
20 |
|
new ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle(), |
26
|
20 |
|
new Dunglas\ActionBundle\DunglasActionBundle(), |
27
|
|
|
|
28
|
|
|
// Webcookcms bundles, loaded via `bundles.php` |
29
|
20 |
|
new Webcook\Cms\SecurityBundle\WebcookCmsSecurityBundle(), |
30
|
20 |
|
new Webcook\Cms\CoreBundle\WebcookCmsCoreBundle(), |
31
|
20 |
|
new Webcook\Cms\I18nBundle\WebcookCmsI18nBundle(), |
32
|
|
|
); |
33
|
|
|
|
34
|
20 |
|
if (in_array($this->getEnvironment(), array('dev', 'test'))) { |
35
|
20 |
|
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
36
|
20 |
|
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); |
37
|
20 |
|
$bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle(); |
38
|
20 |
|
$bundles[] = new Nelmio\ApiDocBundle\NelmioApiDocBundle(); |
39
|
|
|
} |
40
|
|
|
|
41
|
20 |
|
$bundlePath = __DIR__.'/../../../../../../../../tests/bundles.php'; |
42
|
20 |
|
if (file_exists($bundlePath)) { |
43
|
|
|
$sBundles = require $bundlePath; |
44
|
|
|
$bundles = array_merge($bundles, $sBundles); |
45
|
|
|
} |
46
|
|
|
|
47
|
20 |
|
return $bundles; |
48
|
|
|
} |
49
|
|
|
|
50
|
1 |
|
public function registerContainerConfiguration(LoaderInterface $loader) |
51
|
|
|
{ |
52
|
1 |
|
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); |
53
|
|
|
|
54
|
1 |
|
$testConfigPath = __DIR__.'/../../../../../../../../tests/config.yml'; |
55
|
1 |
|
if (file_exists($testConfigPath)) { |
56
|
|
|
$loader->load($testConfigPath); |
57
|
|
|
} else { |
58
|
1 |
|
$loader->load(__DIR__.'/../../../../../tests/config.yml'); |
59
|
|
|
} |
60
|
1 |
|
} |
61
|
|
|
} |
62
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.