As pointed out in a recent comment, when changing your cake version you may find that some of your hand written config files are nolonger compatible with the version of cake you have selected. However by making use of a a custom production setup there is a way to configure your application defensively and in less lines of code.
Every time I use copy, paste & edit, I'm thinking how to avoid doing so. So whenever I started a new application and moved the files around inline with what I described in the Production Setup article, it annoyed me to have to keep redefining the same variables/constants in slightly different ways with the risk of missing one of them or defining them not-quite-right. After setting up a few projects, I had one of those moments of truth that are normally accompanied by the sound of a penny hitting the floor: By not editing directly the app folder that comes with cake, it would always be available to be referred to in it's pristine, checked out state.
A while ago I wrote about how to have a production setup on a shared host, an insightful comment from CraZyLeGs pointed out that the same idea could be extended (on either a shared of dedicated machine) to allow multiple applications to be installed on the same server, and have multiple parallel versions of cake installed as well. For some time, and in reality probably since before the time of writing the initial post, I have been doing exactly that and as it's come up in discussion a few times here's an explanation of exactly how to have multiple applications, with multiple cake installations and mix and match them however you like. First I'll explain where files go, and then show the index.php file that allows you to make it work.
Most websites written in cake will inevitably end up installed on a shared host. Shared hosts are a great compromise between freedom and cost but one of the things that you typically can't do is change the DocumentRoot (the physical directory on the server that corresponds to the url /). The manual explains how to change between a development (extract your cake files and go) style and a production style (nothing except files that should be directly accessible from the web are in the DocumentRoot) install but how you can apply this to a shared host may not be obvious; and this is what I'll try to explain here.
A brief not to say that I'll be putting a couple of Demos back on the site, and I'll be adding to the main demo page as I go. All of the demos will be put up as plugins.
The pagination demo and source has always been available, and adding to that, the the next example is the Title tutorial. A very simple example based on the original tutorial from the wiki demonstrating the use of associations, requestAction, class/method inheritance and AJAX.
Next on the list is to tidy up and make useful the ajax-chat that I wrote a while back, with any luck that will pop up tomorrow.
Following on from my previous post, I thought I'd mention a similar use that can make a developers life a little easier. Usually when developing software there are at least 3 environments: Development, Test and Production. For larger projects there may be more, but for a simple website (and a tiny team of 1) there is often 2 environments: the one on the development machine and the live site.
So picture the scene, you just finished adding some enhancements to your website, all goes remarkably well on your local machine, and after running through your last few tests you decide you are ready for the move to your production server. So, you export the database, initiate the file transfer and then go to your live site and.... disaster: You have a completely blank screen that you desperately want to get rid of. What do you do? The error doesn't occur on your local machine so you have to debug in the production environment - better do it quick before a user notices and phones the helpline... But there is a better way.










