Skip to content

Instantly share code, notes, and snippets.

@mssoylu
Created February 6, 2021 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mssoylu/e1b3a46606a0d408fda92038597d27e9 to your computer and use it in GitHub Desktop.
Save mssoylu/e1b3a46606a0d408fda92038597d27e9 to your computer and use it in GitHub Desktop.
<?
// ...
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config'));
$loader->load('services.xml');
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$definition = $container->getDefinition('acme.social.twitter_client');
$definition->replaceArgument(0, $config['twitter']['client_id']);
$definition->replaceArgument(1, $config['twitter']['client_secret']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment