lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at
PHP: Singleton Pattern for Composed Objects
I usually use a variation of the method below in classes that include a composed object (e.g., a database object):

// method: load composed object
function _load_object()
// already loaded
if ( is_object($this->ComposedObject) ) return;


// create composite object
$this->ComposedObject = new ComposedObject();
// add additional config steps here

// END method

For an example, see the _load_phpmailer method in my CeoFramework class.


Firefox Crashing?
Running Firefox All of the sudden it's been crashing like mad the last couple days. (I'm running it on Windows XP.)

Haven't been able to identify a common thread. I have a page with Google AdWords on it and it crashed it repeatedly.

Saw something somewhere (sorry, didn't bookmark) that suggested disabling Firebug. My AdWords page opened.