private function loadAmqpConfiguration(ContainerBuilder $container, Loader\FileLoader $loader, array $configuration) { // no default connection ? Take the first one if (null === $configuration['default_connection'] || !isset($configuration['connections'][$configuration['default_connection']])) { reset($configuration['connections']); $configuration['default_connection'] = key($configuration['connections']); } // put the default connection on top $default = $configuration['connections'][$configuration['default_connection']]; unset($configuration['connections'][$configuration['default_connection']]); // tip : http://php.net/manual/fr/function.array-unshift.php#106570 $tmp = array_reverse($configuration['connections'], true); $tmp[$configuration['default_connection']] = $default; $configuration['connections'] = array_reverse($tmp, true); foreach ($configuration['gates'] as &$gate) { if (null === $gate['connection']) { $gate['connection'] = $configuration['default_connection']; } } foreach ($configuration as $key => $value) { $container->setParameter('wisembly.amqp.' . $key, $value); } $loader->load('rabbitmq.xml'); }
/** * @param array $config * @param ContainerBuilder $container * @param FileLoader $loader */ private function handleImage(array $config, ContainerBuilder $container, FileLoader $loader) { $loader->load('image.yml'); }
/** * Load the Drush driver. */ private function loadDrush(FileLoader $loader, ContainerBuilder $container, array $config) { if (isset($config['drush'])) { $loader->load('drivers/drush.yml'); if (!isset($config['drush']['alias']) && !isset($config['drush']['root'])) { throw new \RuntimeException('Drush `alias` or `root` path is required for the Drush driver.'); } $config['drush']['alias'] = isset($config['drush']['alias']) ? $config['drush']['alias'] : FALSE; $container->setParameter('drupal.driver.drush.alias', $config['drush']['alias']); $config['drush']['binary'] = isset($config['drush']['binary']) ? $config['drush']['binary'] : 'drush'; $container->setParameter('drupal.driver.drush.binary', $config['drush']['binary']); $config['drush']['root'] = isset($config['drush']['root']) ? $config['drush']['root'] : FALSE; $container->setParameter('drupal.driver.drush.root', $config['drush']['root']); // Set global arguments. $this->setDrushOptions($container, $config); } }
/** * {@inheritdoc} * * @param ContainerConfiguration $containerConfiguration */ public function __construct(ContainerBuilder $container, FileLocatorInterface $locator, ContainerConfiguration $containerConfiguration) { parent::__construct($container, $locator); $this->containerConfiguration = $containerConfiguration; }
/** * Handle helpers. * * @param array $config * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader */ private function handleHelpers(array $config, ContainerBuilder $container, FileLoader $loader) { $loader->load('helpers.yml'); }
public function getAbsolutePath($file, $currentPath = null) { return parent::getAbsolutePath($file, $currentPath); }
/** * BounceFileLoader constructor. * @param ContainerBuilder $container Container to load the config into. * @param FileLocatorInterface $locator Locator that'll be used to lookup files. * @param ProxyGeneratorFactory $proxyGeneratorFactory A proxy generator for lookup methods * @param string[] $customNamespaces Map of custom namespace names to ValueProviders for that namespace. */ public function __construct(ContainerBuilder $container, FileLocatorInterface $locator, ProxyGeneratorFactory $proxyGeneratorFactory = null, $customNamespaces = []) { parent::__construct($container, $locator); $this->proxyGeneratorFactory = $proxyGeneratorFactory; $this->customNamespaces = $customNamespaces; }
/** * Load the Remote driver. */ private function loadRemote(FileLoader $loader, ContainerBuilder $container, array $config) { if (isset($config['remote'])) { $loader->load('drivers/remote.yml'); $config['remote']['login_username'] = isset($config['remote']['login_username']) ? $config['remote']['login_username'] : ''; $container->setParameter('drupal.driver.remote.login_username', $config['remote']['login_username']); $config['remote']['login_password'] = isset($config['remote']['login_password']) ? $config['remote']['login_password'] : ''; $container->setParameter('drupal.driver.remote.login_password', $config['remote']['login_password']); $config['remote']['request_cookie'] = isset($config['remote']['request_cookie']) ? $config['remote']['request_cookie'] : NULL; $container->setParameter('drupal.driver.remote.request_cookie', $config['remote']['request_cookie']); $config['remote']['remote_client'] = isset($config['remote']['remote_client']) ? $config['remote']['remote_client'] : NULL; $container->setParameter('drupal.driver.remote.remote_client', $config['remote']['remote_client']); // Set global arguments. $this->setDrushOptions($container, $config); } }