vendor/waaz/opengraph-bundle/DependencyInjection/WaazOpengraphExtension.php line 22

Open in your IDE?
  1. <?php
  2. namespace Waaz\OpengraphBundle\DependencyInjection;
  3. use Symfony\Component\DependencyInjection\ContainerBuilder;
  4. use Symfony\Component\Config\FileLocator;
  5. use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  6. use Symfony\Component\DependencyInjection\Loader;
  7. use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
  8. /**
  9.  * This is the class that loads and manages your bundle configuration
  10.  *
  11.  * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
  12.  */
  13. class WaazOpengraphExtension extends Extension implements PrependExtensionInterface
  14. {
  15.     /**
  16.      * {@inheritdoc}
  17.      */
  18.     public function prepend(ContainerBuilder $container)
  19.     {
  20.         $configs $container->getExtensionConfig($this->getAlias());
  21.         $resolvingBag $container->getParameterBag();
  22.         $configs $resolvingBag->resolveValue($configs);
  23.         $config $this->processConfiguration(new Configuration(), $configs);
  24.         if ($container->hasExtension('twig') && \class_exists(ExceptionController::class)) {
  25.             $container->prependExtensionConfig('twig', [
  26.                 'exception_controller' => null,
  27.             ]);
  28.         }
  29.         
  30.         if ($container->hasExtension('sulu_admin')) {
  31.             $container->prependExtensionConfig(
  32.                 'sulu_admin',
  33.                 [
  34.                     'forms' => [
  35.                         'directories' => [
  36.                             __DIR__ '/../Resources/config/forms',
  37.                         ],
  38.                     ],
  39.                 ]
  40.             );
  41.         }
  42.         if ($container->hasExtension('sulu_media')) {
  43.             $container->prependExtensionConfig(
  44.                 'sulu_media',
  45.                 [
  46.                     'image_format_files' => [
  47.                         __DIR__ '/../Resources/config/image-formats.xml',
  48.                         '%kernel.project_dir%/config/image-formats.xml',
  49.                     ],
  50.                 ]
  51.             );
  52.         }
  53.     }
  54.     /**
  55.      * {@inheritdoc}
  56.      */
  57.     public function load(array $configsContainerBuilder $container)
  58.     {
  59.         $configuration = new Configuration();
  60.         $config $this->processConfiguration($configuration$configs);
  61.         $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
  62.         $loader->load('services.xml');
  63.     }
  64. }