Hide
on 31/3/07

Have you ever wondered what the reason for that 404 error is when you set debug to 0, or when you move your site onto your live server? How many visitors/clients are confronted by a 404 when they should be looking at the fruits of your work? Cake allows you to modify what happens in the case of an error, and the purpose of this post is to show how to make your site mail you (or the website admin if it's not you) or take whatever other action you might want whenever a 404 is generated.

I'll keep it short and sweet today :). Create the file app/app_error.php app/error.php with the contents below:

on 28/3/07

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.

on 26/3/07

In the past week, a lot happened to this site, and not all of it was good :). Where to begin... the development machine died (hopefully get it back today); I moved all the code from a backup onto my aging laptop, my previous host account expired; I changed hosts to Dreamhost, the update from my laptop to the live version included some code that doesn't work/isn't finished; I upgraded my cake version only to discover some of my code was incompatible; I decided to take advantage of having php5 as an option and discovered some of my code was not php5 compatible etc. etc. But anyway, enough about that, hopefully things are on the up :).

One of the things that unintentionally became visible during all this was a demo I've been working on to demonstrate and test the use of the new MPTT tree behavior. It has a few quirks for which I have written a patch and the demo also serves to test how well, or not, this patch functions. At the time of writing this post the code available for download won't work, but the demo itself at least is fully functional.