Author: Konstantin Kudryashov (ever.zet@gmail.com)
Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function initialize(ExtensionManager $extensionManager)
 {
     $this->driverFactory = new ZitecDriverFactory();
     if (null !== ($minkExtension = $extensionManager->getExtension('mink'))) {
         $minkExtension->registerDriverFactory($this->driverFactory);
     }
 }
Exemplo n.º 2
0
 /**
  * Initializes other extensions.
  *
  * This method is called immediately after all extensions are activated but
  * before any extension `configure()` method is called. This allows extensions
  * to hook into the configuration of other extensions providing such an
  * extension point.
  *
  * @param ExtensionManager $extensionManager
  */
 public function initialize(ExtensionManager $extensionManager)
 {
     $drupalExt = $extensionManager->getExtension("drupal");
     if (!isset($drupalExt)) {
         throw new \Exception("The Drupal Extension must be installed and configured to use the DrupalEntityExtension.");
     }
 }
 /**
  * {@inheritdoc}
  * @param ExtensionManager $extensionManager
  */
 public function initialize(ExtensionManager $extensionManager)
 {
     /** @var MinkExtension $minkExtension */
     $minkExtension = $extensionManager->getExtension('mink');
     if (null !== $minkExtension) {
         $minkExtension->registerDriverFactory(new PhantomJSFactory());
     }
 }
Exemplo n.º 4
0
 /**
  * @inheritdoc
  */
 public function load(ContainerBuilder $container, array $config)
 {
     $container->setParameter('json_spec.excluded_keys', $config['excluded_keys']);
     $container->setParameter('json_spec.json_directory', $config['json_directory']);
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/Resources/services'));
     $loader->load('services.yml');
     if (null !== $this->extensionManager->getExtension('mink')) {
         $loader->load('mink_integration.yml');
     }
 }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function initialize(ExtensionManager $extensionManager)
 {
     /** @var MinkExtension $minkExtension */
     $minkExtension = $extensionManager->getExtension('mink');
     if (null === $minkExtension) {
         return;
     }
     // Overrides default Symfony2Extension driver factory
     // Have to be registered after that one
     $minkExtension->registerDriverFactory(new IsolatedSymfonyFactory());
 }
Exemplo n.º 6
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.º 7
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln(sprintf('%s version %s', $this->application->getName(), $this->application->getVersion()));
     $output->writeln('');
     $debug = $this->configurationLoader->debugInformation();
     $output->writeln('--- configuration');
     $output->writeln(sprintf('    environment variable (%s): %s', $debug['environment_variable_name'], $debug['environment_variable_content']));
     $output->writeln(sprintf('    configuration file: %s', $debug['configuration_file_path']));
     $output->writeln('');
     $debug = $this->extensionManager->debugInformation();
     $output->writeln('--- extensions');
     $output->writeln(sprintf('    extensions loaded: %s', count($debug['extensions_list']) ? implode(', ', $debug['extensions_list']) : 'none'));
     $output->writeln('');
 }
Exemplo n.º 8
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);
     }
 }
Exemplo n.º 9
0
 /**
  * @param ExtensionManager $extensionManager
  */
 private function registerContainers(ExtensionManager $extensionManager)
 {
     /** @var MultiContainerExtension $multiContainerExtension */
     $multiContainerExtension = $extensionManager->getExtension('sylius_multi_container');
     if (null === $multiContainerExtension) {
         return;
     }
     $multiContainerExtension->addContainer('symfony', self::KERNEL_CONTAINER_ID);
     $multiContainerExtension->addContainer('symfony_shared', self::SHARED_KERNEL_CONTAINER_ID);
 }
 /**
  * {@inheritdoc}
  */
 public function initialize(ExtensionManager $extensionManager)
 {
     $extensionManager->activateExtension('SensioLabs\\Behat\\PageObjectExtension');
 }
Exemplo n.º 11
0
 /**
  * {@inheritdoc}
  */
 public function initialize(ExtensionManager $extensionManager)
 {
     if (null !== ($minkExtension = $extensionManager->getExtension('mink'))) {
         $minkExtension->registerDriverFactory(new SymfonyFactory());
     }
 }
Exemplo n.º 12
0
 /**
  * {@inheritDoc}
  */
 public function initialize(ExtensionManager $extensionManager)
 {
     if (null === $extensionManager->getExtension('debug')) {
         $extensionManager->activateExtension('Behat\\DebugExtension');
     }
 }
Exemplo n.º 13
0
 /**
  * @test
  */
 public function initialize()
 {
     $this->extension->initialize($this->extensionManager);
     // After initialization of extension we must have the "debug" initialized also.
     self::assertTrue(null !== $this->extensionManager->getExtension('debug'));
 }