2019-05-23 17:04:48 +02:00
|
|
|
<?php
|
|
|
|
|
2020-07-25 17:40:08 +02:00
|
|
|
namespace Ardent\ParameterBundle\DependencyInjection;
|
2019-05-23 17:04:48 +02:00
|
|
|
|
|
|
|
use Symfony\Component\Config\FileLocator;
|
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
|
|
use Symfony\Component\DependencyInjection\Extension\Extension;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
|
|
|
|
|
|
|
class ArdentParameterExtension extends Extension
|
|
|
|
{
|
|
|
|
public function load(array $configs, ContainerBuilder $container)
|
|
|
|
{
|
|
|
|
$loader = new YamlFileLoader(
|
|
|
|
$container,
|
2020-07-27 00:26:57 +02:00
|
|
|
new FileLocator(dirname(__DIR__).'/Resources/config')
|
2019-05-23 17:04:48 +02:00
|
|
|
);
|
|
|
|
$loader->load('services.yaml');
|
2020-07-27 00:26:57 +02:00
|
|
|
|
|
|
|
$configuration = new Configuration();
|
|
|
|
$config = $this->processConfiguration($configuration, $configs);
|
|
|
|
|
|
|
|
$def = $container->findDefinition('ardent.parameter');
|
|
|
|
$def->setArgument('$config', $config['parameters']);
|
2019-05-23 17:04:48 +02:00
|
|
|
}
|
|
|
|
}
|