Revision #3 has been created by Zolter on Dec 25, 2009, 11:22:35 AM with the memo:
russian link
« previous (#2) next (#4) »
Changes
Title
unchanged
Manage application configuration in different modes
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
Content
changed
[...]
In order to run the application in different modes (production, development, or testing), we should use the corresponding configuration in the entry script. To save the trouble of constantly modifying the entry script to switch the mode, we can create an entry script for each mode. For example, we can have `index.php`, `index-dev.php` and `index-test.php`, corresponding to production, development and testing mode, respectively. In production, we use `index.php` in the browser URL to access the application; in development, we use `index-dev.php` and in testing, we use `index-test.php`.
In a team development environment managed with some source control system (e.g. SVN, CVS, GIT), each developer may want to have his own application configuration (e.g. because he may have a different DB connection setting). In this case, we should only store `main.php` in the repository. The rest of the configuration files should only be kept in each developer's file system to avoid conflict of development configuration changes.
> Tip: The same technique may also be applied to other PHP-based configurations. For example, if we store application parameters (accessed via `Yii::app()->params`) in a PHP file, we can use the above technique to customize parameters in different modes.
### Links
[Russian Version](http://dbhelp.ru/manage-application-configuration/page/)