20 Apr 2009, 2:32 p.m.

A First Look at the New WURFL API for PHP

About a month ago, the New WURFL API for PHP was officially released. While the code had been available in one form or another for some time, the official release coincided nicely with the early stages of a new project at work, so it seemed like an appropriate time to have a look at the API and see if it was something we wanted to use.

By way of a refresher, WURFL is a "Device Description Repository" - a huge open-source XML-based database of information regarding mobile handsets and their capabilities. I've discussed WURFL in the past, for example here. Prior to this release, the only practical method of querying WURFL in real time from PHP was via a library named Tera-WURFL, which I blogged about here. In fact, both WURFL and Tera-WURFL were covered in an article I wrote for php|architect magazine last year.

We've generally been very happy with Tera-WURFL, but it's always worth considering one's options, so what follows is an overview of my experiences with, and first impressions of the New WURFL API.

Posted by Simon Read more »
9 Mar 2009, 4:59 p.m.

Adding a Doctype Declaration to a DOMDocument in PHP

I've recently been spending quite a lot of time with PHP's DOM extension, which is extremely useful for both generating and parsing XML.

In this particular case, I'm generating XML, and it's imperative that the XML markup which the code is generating should contain a Doctype declaration (DTD). It isn't hard to do that using DOM, but it did take a little bit of hunting around in the manual and online, so here's a quick overview of how to add a Doctype declaration to a DOMDocument.

Posted by Simon Read more »
16 Feb 2009, 4:38 p.m.

PHP Closing Tags Considered Harmful

It may be obvious to some, but this is a mistake I still see being made a lot, and I think it's high time we got over it.

Stop using PHP closing tags. It really is that simple, and here's why.

Posted by Simon Read more »
5 Feb 2009, 6:27 p.m.

Syntax Highlighting with GeSHi

On this very site, I've recently started using GeSHi, to implement the rather nifty code syntax highlighting you see in posts like this and this.

I had previously been using PHP's built in highlight_string() function, but that function is only of use for highlighting PHP code! As I often seem to need to highlight other languages, it was time to turn to GeSHi.

Since I did, a couple of people have asked about ease of use, implementation and so forth, so this post is my attempt at answering those questions.

Posted by Simon Read more »
30 Sep 2008, 2:05 a.m.

"Working with Zend Platform" Published

The cover of php|architect's September 08 issue

Another month must be nearly upon us, and with it comes a spanking new issue of php|architect magazine.

I'm pleased to mention that my article all about Zend Platform is featured, along with lots of other goodness.

I found Ivo's introduction to ATK particularly interesting, and it's a tool I'll be pressing into service before long.

I have a couple of ideas for future articles, but they may take a backseat to my studies for the time being.

Posted by Simon Read more »
29 Aug 2008, 10:35 p.m.

August '08 Issue of php|architect Magazine Out Now

The cover of php|architect's August 08 issue

I've just spotted that the August issue of php|architect magazine is now available for download, and it's a top quality issue as always, with articles on writing Wordpress plugins and Facebook apps, an introduction to Adobe's Flex, and finally James Cauwelier's case study of scaling out an e-Commerce site to support a million products.

I'm really pleased to have been involved with the technical editing of this issue, and there's a certain swelling of pride in spotting one's name in the editorial credits (alongside Richard Harrison, I note; Richard being the man responsible for putting ElePHPants on the desks of most of London's PHP developers).

Posted by Simon Read more »
29 Jul 2008, 8:41 p.m.

"PHP Tools for Mobile Web Development" Published

The cover of php|architect's July 08 issue

This is just a quick heads up to say that my article, "PHP Tools for Mobile Web Development" has today been published, and is currently gracing the cover of July's php|architect magazine.

Of course, I jinxed things a little by blogging that it would be published in June, but never mind, we got there.

Big thanks must go to Ciaran for giving the initial draft the once over (on a related note, check out Ciaran's post about web development for the iPhone). Thanks also to my occasional colleague Gerard for clueing me in to the fact that the damn thing had been published.

For what it's worth, php|architect is recommended reading even when I'm not in it, so get yourself over there and get subscribed!

Ok...now to crack on with that second article...

Posted by Simon Read more »
12 Jul 2008, 5:27 p.m.

Benchmarking Zend Download Server

Recently I've started looking into ways that the PHP dev team in which I work can make better use of our Zend Platform installation.

For that reason, the recent Ibuildings/Zend seminar in London on the subject of "Enterprise PHP" was well timed, as it included a pretty detailed run through of a lot of what Platform has to offer.

One feature which really struck me as having the potential to bring performance benefits to one of our systems was the Zend Download Server. Back at the office, I looked into the feature, and ran a few benchmarks. Oddly though, the results don't seem to flatter Zend Download Server.

Posted by Simon Read more »
5 Jul 2008, 1:44 p.m.

Fighting Spam and Digitising Books with reCAPTCHA

When I added a comment form to this blog, I wondered how long it would be before I started getting comment spam. Then I wondered if I was flattering myself to think that spam bots would even be interested in my site.

So it's with mixed emotions that I have to admit that right now the number of spam comments I'm receiving is outstripping the number of genuine comments by a ratio of about 10:1.

The time has come to add a CAPTCHA to the comment form.

Posted by Simon Read more »
3 Jun 2008, 9:45 p.m.

Zend_Search_Lucene Quick Start

I recently had a spontaneous urge to add a search form to my weblog - this one you're reading right now - and it seemed like a good opportunity to have a look at Zend_Search_Lucene.

I'm really impressed with the simplicity and power of the module. Sadly the documentation, whilst extensive, isn't particularly clear - so here's a quick overview of getting Zend_Search_Lucene up and running.

Posted by Simon Read more »
1 Jun 2008, 4:25 a.m.

My php|architect Article to be Published in June

I purposefully didn't mention this here before now, as I didn't want to jinx anything.

But the time has come, and I'm pleasantly surprised to be able to report that my article - named something along the lines of "PHP Tools for Mobile Web Development" - is to be published in the June edition of php|architect magazine.

This will be my first ever contribution to php|architect, so it's a huge compliment that as well as being published somewhat sooner than expected, it looks like becoming the cover feature for June.

We're currently in the final stages of editing, and I'm really enjoying working with editor Steph Fox to turn this into something worth publishing. Stay tuned for further news.

Posted by Simon Read more »
30 Sep 2004, 12:26 p.m.

HOWTO: Install PHP5 on Linux

I did this on a IBM box running Red Hat Linux, I'm not sure which version. It basically went like a dream, and maybe took an hour or so. This is to compile PHP5 as an Apache module, a way I choose as it makes subsequent PHP upgrades simpler. Everything was installed under /usr/local, for what it's worth.

Posted by Simon Read more »