forked from kayue/KayueWordpressBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KayueWordpressBundle.php
39 lines (31 loc) · 1.19 KB
/
KayueWordpressBundle.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
<?php
namespace Kayue\WordpressBundle;
use Doctrine\DBAL\Types\Type;
use Kayue\WordpressBundle\DependencyInjection\Compiler\ShortcodeCompilerPass;
use Kayue\WordpressBundle\DependencyInjection\Security\Factory\WordpressFactory;
use Kayue\WordpressBundle\Types\WordpressIdType;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Kayue\WordpressBundle\Types\WordpressMetaType;
class KayueWordpressBundle extends Bundle
{
public function boot()
{
parent::boot();
if (!Type::hasType(WordpressMetaType::NAME)) {
Type::addType(WordpressMetaType::NAME, 'Kayue\WordpressBundle\Types\WordpressMetaType');
}
if (!Type::hasType(WordpressIdType::NAME)) {
Type::addType(WordpressIdType::NAME, 'Kayue\WordpressBundle\Types\WordpressIdType');
}
}
public function build(ContainerBuilder $container)
{
parent::build($container);
// Security
$extension = $container->getExtension('security');
$extension->addSecurityListenerFactory(new WordpressFactory());
// Shortcode
$container->addCompilerPass(new ShortcodeCompilerPass());
}
}