Legacy code

Some people have this misconception that there is a plot to kill of the original mysql extension (aka ext/mysql) in PHP. So first off, I know that bloggers are not journalist. So apprently fact-checking is not required for a rant blog post. ;-) But if a blog post is a rant, it should be labeled as such. Improved ext/mysqli (hint: “i” as in improved) has been the goto extension for years....

July 17, 2011 · 2 min

RFC: Mocking protected methods

Update, 2011-06-16, 12:15 AM Thanks for the comments. (I swear I had something like that before and it didn’t work!) Here’s the solution: — Original blog entry — I wrote a couple tests for a small CouchDB access wrapper today. But when I wrote the implementation itself, I realized that my class setup depends on an actual CouchDB server being available and here my journey began. Example code Consider the following example:...

June 15, 2011 · 1 min

Dependency Injection Containers

I got into a discussion on Twitter the other day where I mentioned that I don’t like DI. Call it lack of sleep or language barrier (on my part), but I said DI — dependency injection — when I meant the dependency injection container. Having said this, let me explain why I don’t like it. POV Despite not working for any of the larger PHP joints out there, I get to spend my time with pretty interesting stuff....

May 30, 2011 · 3 min

Yahoo: oauth_problem=consumer_key_rejected

Here’s how I literally wasted eight hours of my life. :-) We signed up for Yahoo! Search Boss last week. The process itself was pretty straight: Sign into your Yahoo! account at https://developer.apps.yahoo.com/ Click “New Project”, fill out the form. Then click on the project name, activate “Yahoo! Search Boss” by suppling some billing info. Consumer key rejected? The above process doesn’t even take five minutes, but then I spent eight hours figuring out what oauth_problem=consumer_key_rejected means....

May 22, 2011 · 4 min

A roundhouse kick, or the state of PHP

Last week the usual round of PEAR-bashing on Twitter took place, then this morning Marco Tabini asked if PHP (core) was running out of scratches to itch. He also suggests he got this idea from Cal Evan’s blog post about Drupal forking PHP. http://blog.tabini.ca/2011/04/is-php-running-out-of-itches-to-scratch/ http://blog.calevans.com/2011/04/07/four-reasons-why-drupal-should-fork-php/ [Not submitting to your linkbait.] Pecl and PHP So first off — moving libraries from the core to an external repository was done for various reasons....

April 12, 2011 · 7 min