Archive for the ‘Programming’ Category

Executing a callback for all files in a directory

Posted on June 17th, 2009 in Programming | No Comments »

directory_walk allows running an arbitrary callback on all files in a deep directory structure.

Read the rest of this entry »

Implementing row level access control in CakePHP

Posted on May 2nd, 2009 in Programming | 4 Comments »

The ACL Component in CakePHP is very powerful and can be used to solve a wide variety of access control problems. In this tutorial, we provide a step-by-step guide for implementing row level access control to a model.

Read the rest of this entry »

Creating a community in five minutes with CakePHP

Posted on May 1st, 2009 in Programming | 15 Comments »

CakePHP’s automatic hashing makes things a lot harder than they need to be, and simple tasks (e.g. a registration page) become annoyingly difficult.

Here, we build a complete community based website in five minutes using Cake best practices, with the following features:

  • Account registration
  • Login and logout
  • Account management page
  • Password retrieval
Read the rest of this entry »

Better Error Handling with CakePHP

Posted on April 6th, 2009 in Programming | 5 Comments »

CakePHP is a wonderful framework, but it really drops the ball when it comes to practical error management. In production environments (DEBUG = 0), only 404 or 500 errors are displayed to the user, and no errors are written to the log files.

To solve these two problems we override php’s error handler to enable production error logging, and cake’s error handler to allow forward facing error pages.

Read the rest of this entry »