public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('redis.xml');
$mainConfig = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($mainConfig, $configs);
foreach ($config['class'] as $name => $class) {
$container->setParameter(sprintf('snc_redis.%s.class', $name), $class);
}
foreach ($config['clients'] as $client) {
$this->loadClient($client, $container);
}
if (isset($config['session'])) {
$this->loadSession($config, $container, $loader);
}
if (isset($config['doctrine']) && count($config['doctrine'])) {
$this->loadDoctrine($config, $container);
}
if (isset($config['monolog'])) {
if (!empty($config['clients'][$config['monolog']['client']]['logging'])) {
throw new InvalidConfigurationException(sprintf('You have to disable logging for the client "%s" that you have configured under "snc_redis.monolog.client"', $config['monolog']['client']));
}
$this->loadMonolog($config, $container);
}
if (isset($config['swiftmailer'])) {
$this->loadSwiftMailer($config, $container);
}
if (isset($config['profiler_storage'])) {
$this->loadProfilerStorage($config, $container, $loader);
}
}