Skip to content

Instantly share code, notes, and snippets.

@kriswallsmith
Created May 11, 2010 22:23
Show Gist options
  • Save kriswallsmith/397968 to your computer and use it in GitHub Desktop.
Save kriswallsmith/397968 to your computer and use it in GitHub Desktop.
/**
* Enhance your Symfony 2 kernel to check for a local configuration file.
*/
public function registerContainerConfiguration()
{
$loader = new ContainerLoader($this->getBundleDirs());
$configuration = $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
// check for a local configuration file
if (file_exists($file = __DIR__.'/config/config_local.yml')) {
$configuration->merge($loader->load($file));
}
return $configuration;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment