mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
30 lines
974 B
PHP
30 lines
974 B
PHP
<?php
|
|
|
|
namespace Nelmio\ApiDocBundle\DependencyInjection;
|
|
|
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\Config\Definition\Processor;
|
|
use Symfony\Component\Config\FileLocator;
|
|
|
|
class NelmioApiExtension extends Extension
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function load(array $configs, ContainerBuilder $container)
|
|
{
|
|
$processor = new Processor();
|
|
$configuration = new Configuration();
|
|
$config = $processor->processConfiguration($configuration, $configs);
|
|
|
|
$container->setParameter('nelmio_api_doc.api_name', $config['name']);
|
|
|
|
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
|
$loader->load('formatters.xml');
|
|
$loader->load('request_listener.xml');
|
|
$loader->load('services.xml');
|
|
}
|
|
}
|