Файл: symfony-2.7/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php
Строк: 100
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SymfonyBundleDebugBundleDependencyInjection;
use SymfonyComponentConfigFileLocator;
use SymfonyComponentDependencyInjectionContainerBuilder;
use SymfonyComponentDependencyInjectionLoaderXmlFileLoader;
use SymfonyComponentHttpKernelDependencyInjectionExtension;
/**
* DebugExtension.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class DebugExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$container->getDefinition('var_dumper.cloner')
->addMethodCall('setMaxItems', array($config['max_items']))
->addMethodCall('setMaxString', array($config['max_string_length']));
}
/**
* {@inheritdoc}
*/
public function getXsdValidationBasePath()
{
return __DIR__.'/../Resources/config/schema';
}
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return 'http://symfony.com/schema/dic/debug';
}
}