1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Blast Project package. |
5
|
|
|
* |
6
|
|
|
* Copyright (C) 2015-2017 Libre Informatique |
7
|
|
|
* |
8
|
|
|
* This file is licenced under the GNU LGPL v3. |
9
|
|
|
* For the full copyright and license information, please view the LICENSE.md |
10
|
|
|
* file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
14
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
15
|
|
|
|
16
|
|
|
class AppKernel extends Kernel |
17
|
|
|
{ |
18
|
|
|
/* |
19
|
|
|
* @todo check what we need to register or not |
20
|
|
|
* @todo find a way to load this only on Functional test |
21
|
|
|
* @todo check what need to main composer.json |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
public function registerBundles() |
25
|
|
|
{ |
26
|
|
|
$bundles = [ |
27
|
|
|
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
28
|
|
|
new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
29
|
|
|
new Symfony\Bundle\TwigBundle\TwigBundle(), |
30
|
|
|
// new Symfony\Bundle\MonologBundle\MonologBundle(), |
|
|
|
|
31
|
|
|
// new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), |
|
|
|
|
32
|
|
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
33
|
|
|
// new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
|
|
|
|
34
|
|
|
|
35
|
|
|
// Sonata |
36
|
|
|
new Sonata\CoreBundle\SonataCoreBundle(), |
37
|
|
|
new Sonata\BlockBundle\SonataBlockBundle(), |
38
|
|
|
new Knp\Bundle\MenuBundle\KnpMenuBundle(), |
39
|
|
|
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), |
40
|
|
|
new Sonata\AdminBundle\SonataAdminBundle(), |
41
|
|
|
// new Sonata\IntlBundle\SonataIntlBundle(), |
|
|
|
|
42
|
|
|
|
43
|
|
|
// Blast |
44
|
|
|
new Blast\CoreBundle\BlastCoreBundle(), |
45
|
|
|
]; |
46
|
|
|
|
47
|
|
|
return $bundles; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function registerContainerConfiguration(LoaderInterface $loader) |
51
|
|
|
{ |
52
|
|
|
$loader->load(__DIR__ . '/config/config.yml'); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getCacheDir() |
56
|
|
|
{ |
57
|
|
|
return sys_get_temp_dir() . '/BlastCoreBundle/cache/' . $this->getEnvironment(); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function getLogDir() |
61
|
|
|
{ |
62
|
|
|
return sys_get_temp_dir() . '/BlastCoreBundle/logs'; |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
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.