1 | <?php |
||
11 | class RjFrontendExtension extends Extension |
||
12 | { |
||
13 | /** |
||
14 | * {@inheritdoc} |
||
15 | */ |
||
16 | 20 | public function load(array $configs, ContainerBuilder $container) |
|
17 | { |
||
18 | 20 | $configuration = $this->getConfiguration([], $container); |
|
19 | 20 | $config = $this->processConfiguration($configuration, $configs); |
|
20 | |||
21 | 20 | $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); |
|
22 | 20 | $loader->load('console.yml'); |
|
23 | 20 | $loader->load('version_strategy.yml'); |
|
24 | 20 | $loader->load('manifest.yml'); |
|
25 | |||
26 | 20 | if (version_compare(Kernel::VERSION, '3.3.0', '>=')) { |
|
27 | 20 | $loader->load('commands.yml'); |
|
28 | } |
||
29 | |||
30 | 20 | if ($config['livereload']['enabled']) { |
|
31 | 18 | $loader->load('livereload.yml'); |
|
32 | 18 | $container->getDefinition($this->namespaceService('livereload.listener')) |
|
33 | 18 | ->addArgument($config['livereload']['url']); |
|
34 | } |
||
35 | |||
36 | 20 | $assetExtensionLoader = new AssetExtensionLoader($this->getAlias(), $container); |
|
37 | 20 | $assetExtensionLoader->load($config, $loader); |
|
38 | 20 | } |
|
39 | |||
40 | /** |
||
41 | * @param array $config |
||
42 | * @param ContainerBuilder $container |
||
43 | * |
||
44 | * @return Configuration |
||
45 | */ |
||
46 | 20 | public function getConfiguration(array $config, ContainerBuilder $container) |
|
50 | |||
51 | /** |
||
52 | * @param string $id |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | 18 | private function namespaceService($id) |
|
60 | } |
||
61 |