| Best procedure for including files based on configuration settings [message #103370]
||Sun, 01 August 2010 10:19
Registered: August 2010
I am a complete Symfony beginner and I'm getting nowhere fast, so I need help
Much like in the Jobeet tutorial, I'm using config/ProjectConfiguration.class.php to initialize my application with some libraries I'd written in a previous project, so it looks something like:
static protected $libsLoaded = false;
static public function registerLibs()
// Determine if the libraries have been loaded
self::$libsLoaded = true;
public function setup()
// Enable the Doctrine plugin
// Enable the required libraries
The problem is that I need to include a specific file, depending on a configuration setting.
For example, let's assume I need to include an accounting library based on a country, I was hoping I could define the country setting somewhere and then use sfConfig to include the required file.
I really wanted to place my setting into settings.yml, but that didn't work. So I tried app.yml. Also didn't work. As far as I can see, certain setting files aren't loaded at this point (ie. within ProjectConfiguration.class.php).
So my question is, if I wanted to do something like:
What is the best (ie. most correct in Symfony world) way to go about it? Which files would everyone recommend editing?
I would like this to be on an application wide basis rather than per module.