I made a simple CMS with CakePHP to handle a small (but growing) number of websites. The CMS is constantly evolving as I regularly add features to a development version on my own machine.
I use SVN to trace the evolution of this development version, and that’s pretty much it. To make a new website, I basically copy/paste the dev folder and modify the necessary files before uploading the new website by FTP.
One problem is in the end, every website installation is independent and if I want to add some new features to existing websites, I have to copy files by hand.
Another problem is that some websites have modified versions of the CMS because of specific needs: some controller classes have specific methods not present on the local version.
To sum it up:
- I have one base CakePHP app regularly evolving
- There are multiple versions (=websites) of this app already installed on different servers
- Some websites have custom code included not present in the base version
- I want to be able to easily update all the present and future websites when I improve the base app, without breaking some possible specific parts
Knowing it’s a CakePHP app, what would you do? How should I change my code to manage at the same time the core and the specific code?
Thanks in advance!
You might also consider the option of setting up additional class paths within each of your website applications. You can tell CakePHP to check other directories entirely for files missing from the current application. For example, you could have the following directory structure:
By adding the following to your
/appN/config/bootstrap.phpfiles, you are telling CakePHP to look for controllers in/core/controllersif it can’t find one it’s looking for in the current application.This would, for example, allow you to put all your CMS controllers in
/core/controllersand delete all your/appN/controllersdirectories. Only where a client needed a controller customized (ie./app3above) would you create a controllers directory, copy the specific controller across and make modifications (adding methods and such).(This is the approach the developer of Wildflower CMS took – note the
/wildflowerdirectory.)