|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of tenside/core-bundle. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Christian Schiffler <[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
|
|
|
* This project is provided in good faith and hope to be usable by anyone. |
|
12
|
|
|
* |
|
13
|
|
|
* @package tenside/core-bundle |
|
14
|
|
|
* @author Christian Schiffler <[email protected]> |
|
15
|
|
|
* @author Yanick Witschi <[email protected]> |
|
16
|
|
|
* @copyright 2015 Christian Schiffler <[email protected]> |
|
17
|
|
|
* @license https://github.com/tenside/core-bundle/blob/master/LICENSE MIT |
|
18
|
|
|
* @link https://github.com/tenside/core-bundle |
|
19
|
|
|
* @filesource |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace Tenside\CoreBundle; |
|
23
|
|
|
|
|
24
|
|
|
use Doctrine\Common\Annotations\AnnotationRegistry; |
|
25
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
26
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
|
27
|
|
|
use Tenside\CoreBundle\DependencyInjection\Compiler\AddTaskFactoryPass; |
|
28
|
|
|
use Tenside\CoreBundle\DependencyInjection\TensideCoreExtension; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* This class is the tenside core bundle. |
|
32
|
|
|
*/ |
|
33
|
|
|
class TensideCoreBundle extends Bundle |
|
34
|
|
|
{ |
|
35
|
|
|
/** |
|
36
|
|
|
* {@inheritDoc} |
|
37
|
|
|
*/ |
|
38
|
|
|
public function getContainerExtension() |
|
39
|
|
|
{ |
|
40
|
|
|
return new TensideCoreExtension(); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* {@inheritDoc} |
|
45
|
|
|
*/ |
|
46
|
|
|
public function boot() |
|
47
|
|
|
{ |
|
48
|
|
|
parent::boot(); |
|
49
|
|
|
|
|
50
|
|
|
// Load our annotation if it get's mentioned, Doctrine does not try to autoload it via plain PHP. |
|
51
|
|
|
AnnotationRegistry::registerLoader( |
|
52
|
|
|
function ($class) { |
|
53
|
|
|
if (0 === strcmp('Tenside\CoreBundle\Annotation\ApiDescription', $class)) { |
|
54
|
|
|
class_exists('Tenside\CoreBundle\Annotation\ApiDescription'); |
|
55
|
|
|
return true; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
return false; |
|
59
|
|
|
} |
|
60
|
|
|
); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* Builds the bundle and registers the compiler pass. |
|
65
|
|
|
* |
|
66
|
|
|
* It is only ever called once when the cache is empty. |
|
67
|
|
|
* |
|
68
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance. |
|
69
|
|
|
* |
|
70
|
|
|
* @return void |
|
71
|
|
|
*/ |
|
72
|
|
|
public function build(ContainerBuilder $container) |
|
73
|
|
|
{ |
|
74
|
|
|
parent::build($container); |
|
75
|
|
|
|
|
76
|
|
|
$container->addCompilerPass(new AddTaskFactoryPass()); |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|