-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXaavQueueExtension.php
More file actions
28 lines (22 loc) · 1.04 KB
/
XaavQueueExtension.php
File metadata and controls
28 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
namespace Xaav\QueueBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class XaavQueueExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$config['adapter']['options']['service_container'] = new Reference('service_container');
$adapter = new Definition($config['adapter']['class']);
$adapter->setArguments(array($config['adapter']['options']));
$container->setDefinition('xaav.queue.adapter', $adapter);
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}