forked from Novactive/NovaeZSEOBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NovaeZSEOBundle.php
54 lines (48 loc) · 1.54 KB
/
NovaeZSEOBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* NovaeZSEOBundle Bundle
*
* @package Novactive\Bundle\eZSEOBundle
* @author Novactive <[email protected]>
* @copyright 2015 Novactive
* @license https://github.com/Novactive/NovaeZSEOBundle/blob/master/LICENSE MIT Licence
*/
namespace Novactive\Bundle\eZSEOBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Novactive\Bundle\eZSEOBundle\DependencyInjection\Compiler\CustomFallbackPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
/**
* Class NovaeZSEOBundle
*/
class NovaeZSEOBundle extends Bundle
{
/**
* @param ContainerBuilder $container
*/
public function build( ContainerBuilder $container )
{
parent::build( $container );
$container->addCompilerPass( new CustomFallbackPass() );
}
/**
* {@inheritdoc}
*/
public function getContainerExtension()
{
if (null === $this->extension) {
$extension = $this->createContainerExtension();
if (null !== $extension) {
if (!$extension instanceof ExtensionInterface) {
throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.', get_class($extension)));
}
$this->extension = $extension;
} else {
$this->extension = false;
}
}
if ($this->extension) {
return $this->extension;
}
}
}