Difference between #3 and #5 of
The directory structure of the Yii project site

Revision #5 has been created by resurtm on Aug 13, 2011, 10:54:50 AM with the memo:

Added link to the translated russian version of the article
« previous (#3) next (#7) »


Title unchanged

The directory structure of the Yii project site

Category unchanged


Yii version unchanged

Tags unchanged

directory, config

Content changed

### The Common Directory

The `common` directory contains the files that are shared among applications. For example, every application may need to access the database using ActiveRecord. Therefore, we can store the AR model classes under the `common` directory. Similarly, if some helper or widget classes are used in more than one application, we should also put them under `common` to avoid duplication of code.

To facilitate the maintenance of code, we organize the `common` directory in a structure similar to that of an application. For example, we have `components`,
'`models`, `lib`, etc.

As we will soon explain, applications may also share part of the configurations. Therefore, we also store the common configurations under the `config` directory in `common`.
We then create or modify the local configurations specific for the production server. For example, we may need to adjust the DB connection parameters. We may want to define `YII_DEBUG` to be false in `index.php`.

Because we store each application in a separate directory, if needed, we can deploy them to different servers.
[Russian version](http://resurtm.kz/extensible-yii-directory-structure)
75 0
Viewed: 187 823 times
Version: 1.1
Category: Others
Written by: qiang
Last updated by: Yang He
Created on: Mar 7, 2011
Last updated: 5 years ago
Update Article


View all history