Sharing modules between applications

Hi,

I had investigated Kohana 3 and now decided to go with Yii for our new project. One thing I did not manage to find is how to share modules between various Yii applications. I would like to organise our project like that. Could you help me on how to achieve this and/or suggest different organisation?

The goal in this structure is:

  • Get application code out of the public_html folder

  • Update only one application/module folder for all sites




/

|- libs

|   |-- Yii (the framework)

|   |-- Our Common Modules (i.e. for instance common model classes, forum, ...)

|

|- applications

|   |-- Application for admin

|   |-- Application 1

|   |-- Application 2

|

|- public_html

|   |-- site_admin (using application for admin)

|   |    |-- assets

|   |-- site_1 (using application 1)

|   |    |-- assets

|   |-- site_2 (using application 1)

|        |-- assets

|   |-- site_3 (using application 2)

|        |-- assets

|   |-- site_4 (using application 1)

         |-- assets



I use symbolic links, fast to set up, and easy to maintain.

Your layout is easy to configure. You can use a combination of basePath to let the application know, where it’s protected folder is and use import to add shared folders from other places. The only file required in your public folder is index.php.