Geoffrey Garbers Thoughts on everything from PHP to photography

You are currently viewing the post archives for the "PHP" 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.

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.

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 [...]

CakePHP Script Combiner Helper

Posted 4 months from now.

In developing a recent project, I found myself with the need to combine multiple CSS and Javascript files together. I started to look around for an easy-to-implement helper that can take care of this for me, but from what I could find, everything seemed to require numerous third-party libraries, or the inclusion of a number [...]

EWN.mobi goes live, and gets an “award”!

Posted 4 months from now.

The mobile site for Eyewitness News has finally gone live! It’s been a long road getting to that state, but I can now sit back and watch the site being used. There’s something satisfying about hearing an advertisement on the radio for a mobile site that you know you developed, and that people are using [...]

The lifecycle of a PHP script

Posted 3 months from now.

I was researching some libraries in PHP for the interaction of PHP and XMPP, and stumbled across an interesting article on the life cycle of a PHP script – from initialization to shutdown. It’s an old post (from 2008), but I would imagine the same principles still apply. It’s worth a read if you’re a [...]

Some useful CakePHP bootstrap functions

Posted 2 months from now.

CakePHP has an amazing ability to allow you to customise your application. One such way in which this is done, is through the use of a bootstrap file, that allows you to create functions, or include files application-wide. In this post, I’ll share with you some of the functions that I include in almost every [...]

Downgrading from PHP5.3 on Ubuntu 10.04

Posted 1 week from now.

I performed an upgrade on my work laptop, and upgraded from Ubuntu 9.10 to 10.04. With it came some welcome upgrades, such as Netbeans 6.8 (which is a super awesome IDE, I might add), and a slicker interface, as well as some not-so-welcome upgrades, such as PHP 5.3. Now, PHP 5.3 generates a huge number [...]
End