Skip to content

Instantly share code, notes, and snippets.

@COil
Last active March 11, 2024 12:23
Show Gist options
  • Save COil/f45bd0b96d1162c984a0 to your computer and use it in GitHub Desktop.
Save COil/f45bd0b96d1162c984a0 to your computer and use it in GitHub Desktop.
/**
* Load all ressources needed for the current website.
*
* @param LoaderInterface $loader
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
// Load generic configuration
$loader->load(__DIR__.'/config/config.yml');
// Load website configuration
$loader->load(__DIR__.'/config/website/'.$this->website.'/config.yml');
// Load environment specific configuration
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
/**
* Set the website depending on the Apache env var "sf_site".
*/
public function setWebsite()
{
if (getenv('sf_site')) {
$this->website = getenv('sf_site');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment