Nuff Said.

Posted by John Kleijn • Monday, April 13. 2009 • Category: PHP


function extraStatics() {
    return $this->extraDBFields();
}

/**
* @deprecated 2.3 Use extraStatics()
*/

function extraDBFields() {
    return array();
}
 

(This gem was taken from SilverStripe)

"Don't blame us, blame PHP"

Posted by John Kleijn • Monday, April 13. 2009 • Category: PHP

At SilverStripe, they've gone through great lengths to rape the OO model (seriously, stay clear). But according to SS, their way is the right way, and PHP has it ALL WRONG. The fact that SilverStripe's codebase looks like my kitchen when the gf is out of town, is as defensive as an 80 year old Amish women in a coma, and about as structurally sound as house of cards, is ALL PHP's fault! Obviously is has nothing to with the way they are trying to use static properties. Right.


/**
* ...
*
* Note: please ensure that the static variable that you are overloading is explicitly defined on the class that
* you are extending.  For example, we have added static $has_one = array() to the Member definition,
* so that we can add has_one relationships to Member with decorators.
*
* If you forget to do this, db/build won't create the new relation.
* Don't blame us, blame PHP! ;-)
*/

 

Adding a winky does not make it funny or right, sorry. Actually, double fail for smilies in code. Triple fail for writing the biggest piece of crap in PHP history (and that's saying a lot, MediaWiki anyone?)

Antiquities and such