Sharing the framework directory
If you run multiple Yii projects on a single web server, then you can consider sharing the code in the framework directory between the projects. This will save some disk space and will require less work when you upgrade your applications to a new framework version.
Getting ready
Copy the framework directory contents to /var/www/common/yii/latest.
How to do it...
Carry out the following steps:
Go to
/var/www/common/yii/latestand runyiic webapp /var/www/website1/www/.Go to
/var/www/common/yii/latestand runyiic webapp /var/www/website2/www/.You should get the default web application files under /
var/www/website1/www/and/var/www/website2/www/.That's it! Try to run applications to make sure that everything works.
How it works...
Using yiic webapp from the single framework copy will create applications referencing this framework instance. We have two applications using the same framework copy, so when upgrading framework, we should only replace a single directory...