-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathIgorwFileServeExtension.php
More file actions
23 lines (19 loc) · 1003 Bytes
/
Copy pathIgorwFileServeExtension.php
File metadata and controls
23 lines (19 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
namespace Igorw\FileServeBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Config\FileLocator;
class IgorwFileServeExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setAlias('igorw_file_serve.response_factory', sprintf('igorw_file_serve.response_factory.%s', $config['factory']));
$container->setParameter('igorw_file_serve.base_dir', $config['base_dir']);
$container->setParameter('igorw_file_serve.skip_file_exists', $config['skip_file_exists']);
}
}