forked from seekmas/ChillDevFileManagerBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChillDevFileManagerBundle.php
More file actions
77 lines (68 loc) · 2.13 KB
/
ChillDevFileManagerBundle.php
File metadata and controls
77 lines (68 loc) · 2.13 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* This file is part of the ChillDev FileManager bundle.
*
* @author Rafał Wrzeszcz <rafal.wrzeszcz@wrzasq.pl>
* @copyright 2012, 2014 © by Rafał Wrzeszcz - Wrzasq.pl.
* @version 0.1.3
* @since 0.0.1
* @package ChillDev\Bundle\FileManagerBundle
*/
namespace ChillDev\Bundle\FileManagerBundle;
use ChillDev\Bundle\FileManagerBundle\DependencyInjection\ChillDevFileManagerExtension;
use ChillDev\DependencyInjection\Compiler\TagGrabbingPass;
use ChillDev\DependencyInjection\Validator\InterfaceValidator;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* File manager bundle.
*
* @author Rafał Wrzeszcz <rafal.wrzeszcz@wrzasq.pl>
* @copyright 2012, 2014 © by Rafał Wrzeszcz - Wrzasq.pl.
* @version 0.1.3
* @since 0.0.1
* @package ChillDev\Bundle\FileManagerBundle
*/
class ChillDevFileManagerBundle extends Bundle
{
/**
* Interface name for action handlers service.
*
* @var string
* @version 0.1.3
* @since 0.1.3
*/
const ACTION_INTERFACE_NAME = 'ChillDev\\Bundle\\FileManagerBundle\\Action\\Handler\\HandlerInterface';
/**
* {@inheritDoc}
* @version 0.0.1
* @since 0.0.1
*/
public function getContainerExtension()
{
// this allows us to have custom extension alias
// default convention would put a lot of underscores
if (null === $this->extension) {
$this->extension = new ChillDevFileManagerExtension();
}
return $this->extension;
}
/**
* {@inheritDoc}
* @version 0.1.3
* @since 0.1.3
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
$pass = new TagGrabbingPass(
'chilldev.filemanager.action_handler',
'chilldev.filemanager.actions.actions_manager',
'registerHandler',
'action'
);
$pass->addValidator(new InterfaceValidator(static::ACTION_INTERFACE_NAME));
$container->addCompilerPass($pass, PassConfig::TYPE_OPTIMIZE);
}
}