Geoffrey Garbers Thoughts on everything from PHP to photography

You are currently viewing the post archives for the "Development" category. All the posts below have been assigned to this category for easy reference.

Bootstrapping plugin configuration in CakePHP 2

Posted 3 months ago.

A new feature in CakePHP 2 is the ability to selectively enable and disable plugins in your APP/Config/bootstrap.php file. Plugins are no longer enabled by default in CakePHP 2 – you have to specifically enable them. However, with this functionality comes the ability to load up plugin bootstrap and routing configuration files. However, something to [...]

Static pages in CakePHP

Posted 2 weeks from now.

Generating static pages in CakePHP, without having "/pages/pagename" in your URL has always been a tediously manual affair. However, there is a way to automagically generate the routes for these pages. I'll show you how in this post.

Retrieving the current script’s directory in bash

Posted 1 week from now.

When writing bash scripts to run on Linux, it's often useful to perform operations relative to the executing script's current directory. But how do you get the absolute path to this directory? I have a useful little script that will get the current working path for you.

PHP memory management for variables

Posted 5 days from now.

I just stumbled across a super useful blog post on the internals for PHP’s memory management; and explains the management process quite well. It’s an old article (from 2008), and I’m not too sure how much the memory management has changed, but it still provides some good principles. Think twice before passing that variable by [...]

Easy way to generate CakePHP HABTM joins for use in pagination.

Posted 3 weeks ago.

Most CakePHP developers have come across the pagination of HABTM relationships, and trying to get those relationships to persist through the pagination. In this post, I've managed to wrap a solution to this problem into a single, easy-to-use method that will hopefully helpful other developers in a similar situation to me.

Calculating the distance between two GPS points in MySQL

Posted 1 month ago.

There have been many tutorials floating around the ‘net for a while, detailing how to calculate the distance between an entry in your database, and a set of arbitrary GPS points. Not many of these tutorials will allow you to find the distance between two random points you might have.

You want funky disco? I give you funky disco!

Posted 2 months ago.

I came across a great bit of Javascript that turns a web page into a disco. I thought I’d package it as a bookmarklet, so you can try it out on any site you come across (it seems to work much better in Chrome than it does in Firefox). Warning: If you are epileptic, it [...]

CakePHP 1.3 – An internal error has occurred.

Posted 2 months ago.

When you see the following problem on cake: An Internal Error Has Occurred Error: An Internal Error Has Occurred. This is CakePHP’s new way of telling you something went wrong. You should switch on debugging in app/config/core.php Change it from: Configure::write('debug', 0); to: Configure::write('debug', 2); If you don’t want to switch debugging on, check your [...]