| @@ 11-33 (lines=23) @@ | ||
| 8 | use Symfony\Component\Config\FileLocator; |
|
| 9 | use Symfony\Component\DependencyInjection\Loader; |
|
| 10 | ||
| 11 | class MxKarmaExtension extends Extension |
|
| 12 | { |
|
| 13 | ||
| 14 | /** |
|
| 15 | * Loads a specific configuration. |
|
| 16 | * |
|
| 17 | * @param array $configs An array of configuration values |
|
| 18 | * @param ContainerBuilder $container A ContainerBuilder instance |
|
| 19 | * |
|
| 20 | * @throws \InvalidArgumentException When provided tag is not defined in this extension |
|
| 21 | */ |
|
| 22 | public function load(array $configs, ContainerBuilder $container) |
|
| 23 | { |
|
| 24 | $configuration = new Configuration(); |
|
| 25 | $config = $this->processConfiguration($configuration, $configs); |
|
| 26 | ||
| 27 | $container->setParameter("expansion.plugins.mxkarma", $config); |
|
| 28 | ||
| 29 | $loader = new Loader\YamlFileLoader($container, new FileLocator([__DIR__.'/../Resources/config', './app/config/plugins'])); |
|
| 30 | $loader->load('plugins.yml'); |
|
| 31 | $loader->load('mxkarma.yml'); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| @@ 11-34 (lines=24) @@ | ||
| 8 | Symfony\Component\Config\FileLocator; |
|
| 9 | use Symfony\Component\DependencyInjection\Loader; |
|
| 10 | ||
| 11 | class eXpansionAdminGroupsExtension extends Extension |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * Loads a specific configuration. |
|
| 15 | * |
|
| 16 | * @param array $configs An array of configuration values |
|
| 17 | * @param ContainerBuilder $container A ContainerBuilder instance |
|
| 18 | * |
|
| 19 | * @throws \InvalidArgumentException When provided tag is not defined in this extension |
|
| 20 | */ |
|
| 21 | public function load(array $configs, ContainerBuilder $container) |
|
| 22 | { |
|
| 23 | $configuration = new Configuration(); |
|
| 24 | $config = $this->processConfiguration($configuration, $configs); |
|
| 25 | ||
| 26 | $container->setParameter("expansion.framework.admin_groups.groups", $config['groups']); |
|
| 27 | ||
| 28 | /** @noinspection PhpUndefinedClassInspection */ |
|
| 29 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 30 | $loader->load('helpers.yml'); |
|
| 31 | $loader->load('services.yml'); |
|
| 32 | $loader->load('plugins.yml'); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||