DependencyInjection/PuliExtension.php
public function load(array $configs, ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');

        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.xml');

        if (method_exists('Symfony\Component\DependencyInjection\Definition', 'setFactory')) {
            $loader->load('services-2.7.xml');
        } else {
            $loader->load('services-2.6.xml');
        }

        $twigBundleLoaded = isset($bundles['TwigBundle']);
        $twigExtensionLoaded = class_exists('Puli\TwigExtension\PuliExtension');
        $twigEnabled = $config['twig'];

        if ($twigBundleLoaded && $twigExtensionLoaded && $twigEnabled) {
            $loader->load('twig.xml');
        }
    }
public function load(array $configs, ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');

        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.xml');

        if (method_exists('Symfony\Component\DependencyInjection\Definition', 'setFactory')) {
            $loader->load('services-2.7.xml');
        } else {
            $loader->load('services-2.6.xml');
        }

        $twigBundleLoaded = isset($bundles['TwigBundle']);
        $twigExtensionLoaded = class_exists('Puli\TwigExtension\PuliExtension');
        $twigEnabled = $config['twig'];

        if ($twigBundleLoaded && $twigExtensionLoaded && $twigEnabled) {
            $loader->load('twig.xml');
        }
    }
{@inheritdoc}