1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is a part of Sculpin. |
5
|
|
|
* |
6
|
|
|
* (c) Dragonfly Development Inc. |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Symplify\PHP7_Sculpin; |
13
|
|
|
|
14
|
|
|
use Symfony\Component\DependencyInjection\Compiler\PassConfig; |
15
|
|
|
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\DataSourcePass; |
16
|
|
|
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\DataProviderManagerPass; |
17
|
|
|
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\CustomMimeTypesRepositoryPass; |
18
|
|
|
use Symplify\PHP7_Sculpin\DependencyInjection\Configuration; |
19
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
20
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
21
|
|
|
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\RegisterKernelListenersPass; |
22
|
|
|
use Symplify\SimpleBundle\AbstractSimpleBundle; |
23
|
|
|
|
24
|
|
|
final class SculpinBundle extends AbstractSimpleBundle |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* {@inheritdoc} |
28
|
|
|
*/ |
29
|
|
|
public function build(ContainerBuilder $containerBuilder) |
30
|
|
|
{ |
31
|
|
|
$containerBuilder->addCompilerPass(new DataProviderManagerPass()); |
32
|
|
|
$containerBuilder->addCompilerPass(new CustomMimeTypesRepositoryPass()); |
33
|
|
|
$containerBuilder->addCompilerPass(new DataSourcePass()); |
34
|
|
|
|
35
|
|
|
$containerBuilder->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
protected function getServicesFile() : string |
39
|
|
|
{ |
40
|
|
|
return __DIR__.'/Resources/config/services.yml'; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
protected function getConfiguration() : ConfigurationInterface |
44
|
|
|
{ |
45
|
|
|
return new Configuration(); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
protected function getParametersAliases() : array |
49
|
|
|
{ |
50
|
|
|
return [ |
51
|
|
|
'source_dir' => 'sculpin.source_dir', |
52
|
|
|
'output_dir' => 'sculpin.output_dir', |
53
|
|
|
'permalink' => 'sculpin.permalink', |
54
|
|
|
'raw' => 'sculpin.raw', |
55
|
|
|
]; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|