2019-02-20 11:24:22 +01:00
|
|
|
<?php
|
|
|
|
|
2019-02-20 11:29:03 +01:00
|
|
|
namespace Bluesquare\StorageBundle\DependencyInjection;
|
2019-02-20 11:24:22 +01:00
|
|
|
|
|
|
|
use Symfony\Component\Config\FileLocator;
|
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
2019-02-20 12:28:19 +01:00
|
|
|
use Symfony\Component\DependencyInjection\Definition;
|
2019-02-20 11:24:22 +01:00
|
|
|
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);
|
2019-02-21 13:03:25 +01:00
|
|
|
dump($container); die;
|
2019-02-20 11:24:22 +01:00
|
|
|
$config = $this->processConfiguration($configuration, $configs);
|
|
|
|
|
2019-02-21 12:53:47 +01:00
|
|
|
dump($config); die;
|
|
|
|
|
2019-02-20 12:19:03 +01:00
|
|
|
$definition = $container->getDefinition('bluesquare.storage');
|
2019-02-20 12:31:39 +01:00
|
|
|
$definition->setArgument(0, $config);
|
2019-02-20 12:19:03 +01:00
|
|
|
|
2019-02-20 11:24:22 +01:00
|
|
|
return $config;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAlias()
|
|
|
|
{
|
|
|
|
return parent::getAlias(); // TODO: Change the autogenerated stub
|
|
|
|
}
|
|
|
|
}
|