Symfony\Component\DependencyInjection\ContainerBuilder::getExtensions PHP Method

getExtensions() public method

Returns all registered extensions.
public getExtensions ( ) : Symfony\Component\DependencyInjection\Extension\ExtensionInterface[]
return Symfony\Component\DependencyInjection\Extension\ExtensionInterface[] An array of ExtensionInterface
    public function getExtensions()
    {
        return $this->extensions;
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     // process the configuration of SuluCoreExtension
     $configs = $container->getExtensionConfig($this->getAlias());
     $parameterBag = $container->getParameterBag();
     $configs = $parameterBag->resolveValue($configs);
     $config = $this->processConfiguration(new Configuration(), $configs);
     if (isset($config['phpcr'])) {
         $phpcrConfig = $config['phpcr'];
         // TODO: Workaround for issue: https://github.com/doctrine/DoctrinePHPCRBundle/issues/178
         if (!isset($phpcrConfig['backend']['check_login_on_server'])) {
             $phpcrConfig['backend']['check_login_on_server'] = false;
         }
         foreach ($container->getExtensions() as $name => $extension) {
             $prependConfig = [];
             switch ($name) {
                 case 'doctrine_phpcr':
                     $prependConfig = ['session' => $phpcrConfig, 'odm' => []];
                     break;
                 case 'cmf_core':
                     break;
             }
             if ($prependConfig) {
                 $container->prependExtensionConfig($name, $prependConfig);
             }
         }
     }
     if ($container->hasExtension('massive_build')) {
         $container->prependExtensionConfig('massive_build', ['command_class' => 'Sulu\\Bundle\\CoreBundle\\CommandOptional\\SuluBuildCommand']);
     }
 }
All Usage Examples Of Symfony\Component\DependencyInjection\ContainerBuilder::getExtensions