Hi guys,
Just started with the yii framework, looks like some great work is being done here.
Got a feature request, (I’m hoping it’s not already supported) and I don’t think it is, for extra flexibility in sepcifying the config environments.
The problem I have is that in our team, we need different test configurations for our different developers. (It’s also conceivable that we would need different ‘main’ configurations for different installations).
An easy example is this.
-
I am developing on a mac and have my own local copy of the database, which I’ve given one name, ‘paul-dev’ say (silly name I know, but for argument…).
-
Sam over there is working on windows, and his dev database is sitting on a linux server in the corner, and is called ‘linux-test’ say
This means that we need two different config/test.php files. The problem is, when I ‘svn commit’ my test.php to the repository, and Sam does an ‘svn update’ he’ll get a conflict with his settings.
There are similar issues if I have several webservers running the app, and we need different configurations for each of them. Maybe there are subnets etc. and NAT’ing going on which means databases are on different IP addresses, say.
What I’m proposing is, leaving main.php and test.php working fine for the developers who just need them, but having the ability to also do
test.paul-mac.php
test.sam-windows.php
main.server1.php
main.server2.php
these could inherit from test.php and main.php if they wanted to. Which one gets picked up could be controlled by an environment variable, YII_ENVIRONMENT, say.
If the environment variable is not set, then the index.php, index_test.php, bootstrap.php could just default to picking up main.php, test.php.
(In truth we could lose index.php and just go off an environment variable for test/dev, but maybe that’s another discussion).
Let me know what you guys think. If you reckon this is a good idea I’ll be happy to put it together and submit a patch.
Cheers,
Paul.