getExtensions() public method

Returns all available extensions.
public getExtensions ( ) : Behat\Testwork\ServiceContainer\Extension[]
return Behat\Testwork\ServiceContainer\Extension[]
Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (class_exists('Symfony\\Component\\Config\\Definition\\Dumper\\YamlReferenceDumper')) {
         $dumper = new YamlReferenceDumper();
     } else {
         // Support Symfony Config 2.3
         $dumper = new ReferenceDumper();
     }
     $configTree = new ConfigurationTree();
     $output->writeln($dumper->dumpNode($configTree->getConfigTree($this->extensionManager->getExtensions())));
 }
Exemplo n.º 2
0
 /**
  * Loads all extensions into container using provided config.
  *
  * @param ContainerBuilder $container
  * @param array            $config
  *
  * @throws ExtensionException
  */
 private function loadExtensions(ContainerBuilder $container, array $config)
 {
     // Load default extensions first
     foreach ($this->extensionManager->getExtensions() as $extension) {
         $extensionConfig = array();
         if (isset($config[$extension->getConfigKey()])) {
             $extensionConfig = $config[$extension->getConfigKey()];
             unset($config[$extension->getConfigKey()]);
         }
         $this->loadExtension($container, $extension, $extensionConfig);
     }
     // Load activated extensions
     foreach ($config as $extensionConfigKey => $extensionConfig) {
         if (null === ($extension = $this->extensionManager->getExtension($extensionConfigKey))) {
             throw new ExtensionException(sprintf('None of the activated extensions use `%s` config section.', $extensionConfigKey), $extensionConfigKey);
         }
         $this->loadExtension($container, $extension, $extensionConfig);
     }
 }