Archive for the ‘PHP’ Category.

Top 10 Posts of 2011

Following in the trail blazed by the likes of Cal Evans and Chris Cornutt, I decided to post a list of the posts on this blog that have received the most traffic this year along with some related commentary. However, in the spirit of Charles St. Michael, I decided to up the number of posts from three to 10. So, here we go:

10. Building PHP-GTK with Cairo Support on Ubuntu Jaunty – 2009-04-25

Very interesting that this post was in the running at all. It’s over two years old, goes back five Ubuntu versions, and deals with PHP 5.3.0RC1 (current is 5.4.0RC4) and PHP-GTK when Cairo support was relatively new. (There’s now a separate PECL extension for it now.) If you want to learn more about this, you should definitely check out Elizabeth Smith and Michael Maclean.

9. Renaming a DOMNode in PHP – 2010-02-09

It seems this isn’t as uncommon a problem as I would have thought. Sadly, in the 22 months that have passed since I authored the post, it seems the DOM extension hasn’t been updated further to support the DOM 3.0 standard or the renameNode() method mentioned in this post.

8. PHP_CodeSniffer Article in php|architect – 2011-04-28

It’s nice to see this post get attention even if was just a brief hand-waving to point people to the article, which is one of two I wrote for php|architect Magazine this year. It’s also nice to see that despite being seen by some as a more menial facet of quality assurance, other people consider it important enough to read the article and take something away from it.

7. ‘New SPL Features in PHP 5.3’ Hits php|architect – 2011-02-01

Another post that was just hand-waving to an article that dealt with a topic I saw as underrated. The article followed my php|tek 2010 session and preceded a Zend webinar this year on the same topic.

6. Process Isolation in PHPUnit – 2010-08-19

Between views and comments, it seems I wasn’t the only one who ran into this head-scratcher. However, if memory serves, I think there are plans to remove this feature from PHPUnit in future versions.

5. Node.js: A Beginner’s Perspective – 2010-10-19

The post is about a year old now, and sadly I haven’t done anything of merit with Node.js since (though I hope to change that), but it seems the community is still as vibrant and growing as it ever was. Heck, you can even integrate PHP-FPM with Node via FCGI now. Node is definitely a technology to continue keeping your eye on if you don’t already use it.

4. PHPUnit and Xdebug on Ubuntu Karmic – 2010-01-03

It’s surprising that this post is still relevant since there have been four Ubuntu releases since the version that this post deals with. I’ve since moved over to Fedora 16, at least for now, and it seems to address most of my regular needs. I may look at other distributions like Mint later on.

3. Models in Zend Framework – 2010-03-26

Even though it’s over a year old now, I think this post gets the traffic it does because there’s not really one prescribed way to build models and because the existing documentation describes a number of components that can be used to build models, but doesn’t really offer specific guidance on how to approach it. Bit of a double-edged sword, I suppose.

2. New SPL Features in PHP 5.3 – 2010-05-20

I published this post on the same day that I gave my session on the topic at php|tek 2010. It’s one of my longer and more content-rich posts and I’ve updated it on occasion as I’ve had cause to update the benchmarks that go along with it. Good to see that interest in SPL seems to be rising.

1. Database Testing with PHPUnit and MySQL – 2010-01-04

While I love that this post is driving as much traffic to my blog as it is, I do want to get around to contributing related documentation to the PHPUnit project. Hopefully that will happen soon. In the meantime, you can also read more about this topic in the Testing chapter of my most recent book.

So, one big take-away from this post has been that most of my high-traffic posts were written last year rather than this year. I can’t say it’s very surprising since, looking back, a number of my posts from this year were of the hand-waving variety. I’m hoping to publish more content-rich posts more frequently in 2012. I won’t call it a resolution, because I’d likely be jinxing myself in the process, but I will say that I’ll make my best attempt.

Best wishes to everyone in the new year.

Appearance on the Engine Yard Podcast

The wonderful folks at Engine Yard invited me and my friends and fellow co-authors Lorna Jane Mitchell and Davey Shafik to be guests on an episode of their PHP podcast with our good mutual friend Elizabeth Naramore as our host.

We discuss our recently published book PHP Master: Write Cutting Edge Code, how SitePoint brought us together to work on the project, what it was like to write the book, and some reflections on the experience from each of us.

If you’ve heard about the book and not read it or been curious as it, I heartily recommend giving it a listen.

PHP Master Published by SitePoint

I’m very happy to announce that I’ve had a second book published: “PHP Master: Writing Cutting-Edge Code.” This time, I had the honor and pleasure of co-authoring the content with my good friends and peers in the PHP community Lorna Jane Mitchell and Davey Shafik and working with the excellent team at SitePoint to make it available to you. The book covers a number of fundamental skills for professional PHP developers including web services, design patterns, security, testing, and more. If you’re in the market for such a PHP title, I encourage you to consider checking it out.

New Articles on

I recently started writing articles for, a site managed by SitePoint that syndicates PHP tutorials, opinions, and news. You can check out these articles, “Documentation Makes the World Go Round” and “Integrating Amazon S3 using PEAR”, at either or If you prefer getting your news via Twitter, check out @phpmasterdotcom or @sitepointdotcom. Hope you find the articles useful.

ledger stats

Occasionally, I need to take a break from the projects I’m working on. How do I do that? By working on another project, of course!

Just over a year ago, I found ledger and began using it to manage my household finances. Some people may find that sort of thing boring, but I think it’s it neat to look at the past year’s worth of transactions, get a bird’s eye view of our spending, identify trends, and so forth.

I’ve had it in the back of my mind lately that I’d like a better and preferably more visual way to do those things. After perusing through a few charting libraries, I found that Highcharts seem to do what I needed. Among other things, it provides a plugin for the the JavaScript library I’m most familiar with: jQuery.

I already had a bit of PHP code lying around to parse ledger’s XML output, give me a monthly spending breakdown by account, and output it in CSV format. I lifted the parsing logic, wrote some more PHP to search transactions by several criteria based on form input, implemented a very simple plugin system to consume the search results and output various charts, and wrote a few simple plugins. Thus, ledger stats was born.

It’s still in a very rough prototypical stage, but it’s got enough functionality for others to start playing around with it. Feel free to fork it on GitHub and suggest improvements.

php|tek 2011 Slides

If you attended my sessions at the php|tek 2011 conference, thank you! I’ve linked to my slide decks below. Simply extract them and open the HTML files in any browser. Also, if you haven’t already done so, please take a moment to use the links below to leave feedback. Thanks in advance!

  • Accessing Web Resources with PHP session – slides, feedback
  • Creating Desktop Applications with Titanium and PHP session – slides, feedback
  • Introduction to Android Development unconference session – slides, comment on this blog post to leave feedback

Looking forward to php|tek 2011

It’s been a few months since I mentioned it, but php|tek 2011 is quickly closing in on us. I’ll be attending with several of my fellow Synacorians as well as giving two sessions, Accessing Web Resources with PHP and Creating Desktop Application with Titanium and PHP.

Synacor, the company I work for, is one of the sponsors for php|tek. Knowing how much we all enjoy these conferences, I encourage you to take a moment while you’re at php|tek and voice your appreciation to Synacor representatives. Also, if you’re in the market for a job, consider applying there to join me in working on cool stuff with smart people.

Lastly, consider placing this badge on your web site or blog to promote the conference.

I look forward to seeing you there.

tek Chicago May 24-27 2011 Speaker

PHP_CodeSniffer Article in php|architect

The April 2011 issue of php|architect Magazine was published today and includes an article by me entitled “Keeping Code Smelling Pretty With PHP_CodeSniffer.” Feel free to leave a comment on this blog post if you read it and enjoy it or have a suggestion on how to improve my presentation of the material. Thanks in advance!

Spot on Voices of the Elephpant

I recently did a brief interview that’s been published as an episode of the Voices of the Elephpant PHP podcast. The first question deals with my experience with PHP, but the other two deal more with my experience with open source projects in general. Thanks to Cal Evans for inviting me to participate. I highly recommend you check out other episodes of the podcast if you haven’t already; I’ve really enjoyed listening to them.

Speaking at Confoo and php|tek

2011 seems to be a year of multiple firsts for me.

First, I’ve been invited to speak at Confoo. I’ve submitted there before, but this year is the first time I’ve been accepted. This will be my first trip outside of the United States, as Confoo is held in Canada, more specifically Montreal. I’ve never spoken at a conference on a topic that wasn’t PHP-related, but this time I’ll be venturing outside of my comfort zone to speak on developing REST web services with Jersey, a framework written in Java that I used as part of a work project at Synacor for the latter half of last year.

Second, I’ve also been invited back to speak at php|tek. I spoke there last year on the new SPL features available in PHP 5.3. I haven’t spoken at the same conference twice, but I’ll be happy to return to this one as I consider it one of the best PHP conferences in this hemisphere. I’ll also be giving two presentations, one on web scraping accessing web resources in PHP (thanks Cal) and the other on creating applications with Titanium and PHP.

If you plan on attending either of these conferences, please take the opportunity to say hello and introduce yourself. I look forward to seeing you!