mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
29 lines
861 B
PHP
29 lines
861 B
PHP
<?php
|
|
|
|
namespace Flasher\Symfony\DependencyInjection;
|
|
|
|
use Symfony\Component\Config\FileLocator;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\DependencyInjection\Loader;
|
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|
|
|
final class FlasherExtension extends Extension
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*
|
|
* @throws \Exception
|
|
*/
|
|
public function load(array $configs, ContainerBuilder $container)
|
|
{
|
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
|
$loader->load('config.yaml');
|
|
|
|
$configuration = new Configuration();
|
|
$config = $this->processConfiguration($configuration, $configs);
|
|
|
|
$notifyConfig = $container->getDefinition('flasher.config');
|
|
$notifyConfig->replaceArgument(0, $config);
|
|
}
|
|
}
|