Zend Framework Autoload Classes

August 16, 2010
Thumbnail image for Zend Framework Autoload Classes

I wanted to add another library of classes to a Zend Framework project and autoload them, I created a folder called application/vendors/ to hold vendor libraries in seperate folders of their own. For example, using some CURL classes from Sem Labs, these classes would live in the application/vendors/semlabs/ folder.

Read the full article →

Jquery Lightbox Not Working?

August 13, 2010
Thumbnail image for Jquery Lightbox Not Working?

Had a struggle getting this jquery lightbox working recently, the solution for me was to alter the markup of the popup div because some divs were not closing correctly with />.

Read the full article →

Call user function for magic method PHP

August 11, 2010
Thumbnail image for Call user function for magic method PHP

Put a bit of work into upgrading the blog and might as well make a quick post now. Heres a trick to test if a class variable exists, isset or has a particular value dynamically. Call the magic method __get() for the variable name which you can generate on the fly.

Read the full article →

Silverstripe 2.4 Image Gallery Tutorial

June 10, 2010
Thumbnail image for Silverstripe 2.4 Image Gallery Tutorial

I have had a few issues installing image gallery modules on Silverstripe 2.4. I’m new to using silverstripe so this is a beginners tutorial, the aim is to install a basic image gallery which fits the following criteria: Allow CMS users to upload photos Add custom fields to be associated with each image (such as [...]

Read the full article →

vnStat hack to measure data usage in a given billing cycle

June 9, 2010
Thumbnail image for vnStat hack to measure data usage in a given billing cycle

I’m using vnStat to measure internet usage on my Ubuntu 10.04 laptop, coupled with the vnStat PHP frontend it works nicely. Only problem was the summaries of disk usage started at the beginning of the month (sensibly) and we get billed on the 23rd, which is when our month ticks over and we get a [...]

Read the full article →

Silverstripe Captcha

May 27, 2010
Thumbnail image for Silverstripe Captcha

Starting out on some silverstripe projects there will likely be a few bits and pieces finding their way to the blog. SilverStripe is a product I have always wanted to work with, besides being a great example of open source success in New Zealand I’m attracted to the MVC architecture. I’ve had a few teething [...]

Read the full article →

Rolling out an API for your cakePHP app Part 3: Handling Errors

April 30, 2010
Thumbnail image for Rolling out an API for your cakePHP app Part 3: Handling Errors

The last posts in this series covered the a basic architecture of an API in cakePHP, the limitations of that basic architecture and a possible solution using an API component and some external API classes. The last part is the handling of API specific errors. The goals for the error handling system: Return specific error [...]

Read the full article →

Rolling out an API for your cakePHP app Part ++1: The Solution

April 30, 2010
Thumbnail image for Rolling out an API for your cakePHP app Part ++1: The Solution

In the previous post I covered creating a basic API using cakePHP and what limitations are imposed if you want to extend the API over the course of several versions. This post is going to cover the architecture of a possible solution, I don’t claim its the best solution out there and feedback is welcomed. [...]

Read the full article →

Rolling out an API for your cakePHP app Part 1: The Problems

April 29, 2010
Thumbnail image for Rolling out an API for your cakePHP app Part 1: The Problems

Recently I’ve put a lot of work into an API solution for a cakePHP app which addresses some of the architectural issues of creating an API in a cakePHP project. To start with I threw together a nice simple API as a proof of concept and to showcase the ease at which an API can [...]

Read the full article →

CakePHP session expire bug

April 8, 2010
Thumbnail image for CakePHP session expire bug

UPDATE: This bug has been fixed. This auth component / request handler component “bug” drops the 403 header code from an AJAX response when the session has timed out. Note: this is based on cakePHP version 1.2.4.8284 and may have been fixed already I haven’t checked.

Read the full article →