Weblog

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.

Continue reading A First Look at the New WURFL API for PHP »

Posted on Monday, the 20th of April, 2009 | permalink | comments (5)

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.

Continue reading Adding a Doctype Declaration to a DOMDocument in PHP »

Posted on Monday, the 9th of March, 2009 | permalink | comments (8)

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.

Continue reading PHP Closing Tags Considered Harmful »

Posted on Monday, the 16th of February, 2009 | permalink | comments (3)

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.

Continue reading Syntax Highlighting with GeSHi »

Posted on Thursday, the 5th of February, 2009 | permalink | comments (1)

"Working with Zend Platform" Published

Posted on Tuesday, the 30th of September, 2008 | permalink | comments (0)

August '08 Issue of php|architect Magazine Out Now

Posted on Friday, the 29th of August, 2008 | permalink | comments (0)

"PHP Tools for Mobile Web Development" Published

Posted on Tuesday, the 29th of July, 2008 | permalink | comments (1)

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.

Continue reading Benchmarking Zend Download Server »

Posted on Saturday, the 12th of July, 2008 | permalink | comments (1)

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.

Continue reading Fighting Spam and Digitising Books with reCAPTCHA »

Posted on Saturday, the 5th of July, 2008 | permalink | comments (0)

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.

Continue reading Zend_Search_Lucene Quick Start »

Posted on Tuesday, the 3rd of June, 2008 | permalink | comments (8)

My php|architect Article to be Published in June

Posted on Sunday, the 1st of June, 2008 | permalink | comments (1)

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.

Continue reading HOWTO: Install PHP5 on Linux »

Posted on Thursday, the 30th of September, 2004 | permalink | comments (0)