src/DependencyInjection/PhpMobSettingsExtension.php
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

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

        $schemaRegistryDef = $container->getDefinition('phpmob.settings.schema_registry');

        foreach ($config['schemas'] as $section => $data) {
            $schemaRegistryDef->addMethodCall('add', [$section, $data]);
        }

        if ($config['cache']['service']) {
            $cachedDefinition = $container->getDefinition('phpmob.settings.cached_manager');
            $cachedDefinition->setAbstract(false);
            $cachedDefinition->setLazy(true);
            $cachedDefinition->setDecoratedService('phpmob.settings.manager');
            $cachedDefinition->setArgument(0, new Reference('phpmob.settings.cached_manager.inner'));
            $cachedDefinition->setArgument(1, new Reference($config['cache']['service']));
            $cachedDefinition->setArgument(2, $config['cache']['lifetime']);
        }
    }
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

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

        $schemaRegistryDef = $container->getDefinition('phpmob.settings.schema_registry');

        foreach ($config['schemas'] as $section => $data) {
            $schemaRegistryDef->addMethodCall('add', [$section, $data]);
        }

        if ($config['cache']['service']) {
            $cachedDefinition = $container->getDefinition('phpmob.settings.cached_manager');
            $cachedDefinition->setAbstract(false);
            $cachedDefinition->setLazy(true);
            $cachedDefinition->setDecoratedService('phpmob.settings.manager');
            $cachedDefinition->setArgument(0, new Reference('phpmob.settings.cached_manager.inner'));
            $cachedDefinition->setArgument(1, new Reference($config['cache']['service']));
            $cachedDefinition->setArgument(2, $config['cache']['lifetime']);
        }
    }
{@inheritdoc}