Permalink
Browse files

Add support for environmental services configuration and support only…

… yml
  • Loading branch information...
1 parent bb3fd85 commit bfdc33a3b62a16f3e9e55c141eb5ac6b4b68fcc7 @everzet everzet committed Nov 26, 2012
Showing with 7 additions and 9 deletions.
  1. +7 −9 AppBundle/ContainerExtension.php
@@ -26,18 +26,16 @@ public function getAlias()
*/
public function load(array $configs, ContainerBuilder $container)
{
+ $environment = $container->getParameter('kernel.environment');
+ $loader = new Loader\YamlFileLoader(
+ $container, new FileLocator($this->path.'/Resources/config')
+ );
+
if (file_exists($this->path.'/Resources/config/services.yml')) {
- $loader = new Loader\YamlFileLoader(
- $container, new FileLocator($this->path.'/Resources/config')
- );
$loader->load('services.yml');
}
-
- if (file_exists($this->path.'/Resources/config/services.xml')) {
- $loader = new Loader\XmlFileLoader(
- $container, new FileLocator($this->path.'/Resources/config')
- );
- $loader->load('services.xml');
+ if (file_exists($this->path.'/Resources/config/services_'.$environment.'.yml')) {
+ $loader->load('services_'.$environment.'.yml');
}
}
}

0 comments on commit bfdc33a

Please sign in to comment.