|
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 Sculpin\Bundle\SculpinBundle; |
|
13
|
|
|
|
|
14
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\ConverterManagerPass; |
|
15
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\DataSourcePass; |
|
16
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\DataProviderManagerPass; |
|
17
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\FormatterManagerPass; |
|
18
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\GeneratorManagerPass; |
|
19
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\PathConfiguratorPass; |
|
20
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\CustomMimeTypesRepositoryPass; |
|
21
|
|
|
use Sculpin\Bundle\SculpinBundle\DependencyInjection\Configuration; |
|
22
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
|
23
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
24
|
|
|
use Symplify\SimpleBundle\AbstractSimpleBundle; |
|
25
|
|
|
|
|
26
|
|
|
final class SculpinBundle extends AbstractSimpleBundle |
|
27
|
|
|
{ |
|
28
|
|
|
/** |
|
29
|
|
|
* {@inheritdoc} |
|
30
|
|
|
*/ |
|
31
|
|
|
public function build(ContainerBuilder $containerBuilder) |
|
32
|
|
|
{ |
|
33
|
|
|
$containerBuilder->addCompilerPass(new ConverterManagerPass()); |
|
34
|
|
|
$containerBuilder->addCompilerPass(new DataProviderManagerPass()); |
|
35
|
|
|
$containerBuilder->addCompilerPass(new FormatterManagerPass()); |
|
36
|
|
|
$containerBuilder->addCompilerPass(new GeneratorManagerPass()); |
|
37
|
|
|
$containerBuilder->addCompilerPass(new PathConfiguratorPass()); |
|
38
|
|
|
$containerBuilder->addCompilerPass(new CustomMimeTypesRepositoryPass()); |
|
39
|
|
|
$containerBuilder->addCompilerPass(new DataSourcePass()); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
protected function getServicesFile() : string |
|
43
|
|
|
{ |
|
44
|
|
|
return __DIR__.'/Resources/config/services.yml'; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
protected function getConfiguration() : ConfigurationInterface |
|
48
|
|
|
{ |
|
49
|
|
|
return new Configuration(); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
protected function getParametersAliases() : array |
|
53
|
|
|
{ |
|
54
|
|
|
return [ |
|
55
|
|
|
'source_dir' => 'sculpin.source_dir', |
|
56
|
|
|
'output_dir' => 'sculpin.output_dir', |
|
57
|
|
|
'permalink' => 'sculpin.permalink', |
|
58
|
|
|
'raw' => 'sculpin.raw', |
|
59
|
|
|
]; |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|