37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Bluesquare\StorageBundle\DependencyInjection;
|
|
|
|
use Symfony\Component\Config\FileLocator;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\DependencyInjection\Definition;
|
|
use Symfony\Component\DependencyInjection\Extension\Extension;
|
|
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
|
|
|
class StorageExtension extends Extension
|
|
{
|
|
|
|
/**
|
|
* Loads a specific configuration.
|
|
*
|
|
* @throws \InvalidArgumentException When provided tag is not defined in this extension
|
|
*/
|
|
public function load(array $configs, ContainerBuilder $container)
|
|
{
|
|
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Ressources/config'));
|
|
$loader->load('services.yaml');
|
|
$configuration = $this->getConfiguration($configs, $container);
|
|
$config = $this->processConfiguration($configuration, $configs);
|
|
|
|
$definition = $container->getDefinition('bluesquare.storage');
|
|
$definition->setArgument('user_config', $config);
|
|
|
|
return $config;
|
|
}
|
|
|
|
public function getAlias()
|
|
{
|
|
return parent::getAlias(); // TODO: Change the autogenerated stub
|
|
}
|
|
}
|