*adjective, easily modified or changed; opposite of hardcoded

web design article

    home »  site map »  e-mail » 

Interview with Wez Furlong at php|works Toronto, Sept 12 - 15 2006

Originally published at unixreview.com

Wez Furlong is Chief Architect at OmniTI, Inc., and a PHP core developer responsible for the streams abstraction layer, the PDO extension, and the SQLite extension among others. We caught up with him at the php|works conference where he presented a seminar on PHP Data Objects (PDO).

You must have a pretty busy schedule working on PHP, as lead architect at OmniTI and you want a personal life too I'm sure. How did you come to be involved with PHP?

The way I got into PHP initially was this company I worked for in England did various different kinds of professional services consulting. One of the projects we had was a website where you could go in and advertise your house for sale so you could privately sell your home. A place where you could put the details up and people could find it.

And that site was written using ASP classic, as it is called now. This client come to us and said "We would like to build an e-learning application but it needs to run on Solaris". We had heard of PHP--PHP 4 was just coming out around then. So we thought we'd give it a go. We got the site up but one of the things they needed was a payment processing gateway for credit card payments. We had to use cURL to make that work. But there is no reason you have to use cURL to make that work. PHP could already use fopen() to make an HTTP connection, so I came up with a pretty small patch to enable SSL support so that we could fopen() an HTTPS connection. The way that needed to be implemented was a real problem - the internals around that time were a bit of a hack so, to make that work, to maintain that hack was also a hack. It was kind of ugly. It was based on feedback from that patch that I ended up developing the streams layer. It took me about nine months to go through all the corners of PHP in my spare time and get it all working. It was just an interesting project. One of the things I like doing is looking at the way developers are using things and finding better ways to make their life easier, make their work less. It was good fun to do that. And PDO is the same kind of thing.

The whole of PHP is that kind of thing, right? It's made up of numerous extensions.

Some parts are much better than others. We have a lot of API's. Some of them are hard to use. Some of the more recent ones are easy to use and actually make things much more pleasant. I find it interesting to build that kind of thing.

You are working for a pretty good company too that will allow you to attend PHP conferences- I guess they're paying the bills right now?

I am full-time for OmniTI, I am actually on company time as their representative.

They're pretty open source friendly.

Yes - we're strong proponents of open source. pretty much all our senior staff are contributors to open source in one form or another.

I think I saw George [Schlossnagel] here last year.

Yeah, we also have Theo [Schlossnagel] who is more into the Apache side of things than PHP, Laura Thompson who is the author of a best-selling PHP book, and we have Chris Shiflett now too.

Oh, right, yes.

Who else have we got? Somebody starting on the 20th. Actually Robert Treat is starting to work for OmniTI shortly. He did one of the Postgres talks here. Yeah, we keep our eye out. One of the nice things about open source is that you can see exactly what somebody's done. You can look at projects that they have worked on in the past and see the kind of things they've done. Generally speaking, people who contribute to open source tend to have a passion for it and that's a big selling point. If your hiring someone you want them to be interested in what they're doing. So it's good for the business from that point of view, but also good from a marketing perspective.

So as far as OmniTI is concerned - this gives them added credibility with their customers?

It does. I like to think we have tremendous appeal because people can see the result of our contributions - between George, Theo and myself our code is used by probably most of the websites around the world in some form or another. If you think about it it's pretty impressive. If you stop and think about it, Britneyspears.com runs PHP. Not to say Britney chose PHP, but that site is running code that we wrote and it reaches out far beyond the people that we know directly. There are bigger, more impressive sites out there, of course.

Between us we do a lot of stuff that drives portions of the internet; that and the fact that we publish and give talks on that helps to sell the professional services side of our company and it can also impress customers on the product side.

Those that know open source too - naturally I guess, would be the ones to be impressed, correct? If you don't know open source from proprietary it's not going to mean anything so that is going to condition the kind of customers you get too I would imagine?

Yes and no. Some of our customers don't really care whether we've done open source stuff or not. Especially on the product side. They don't really care so long as it works well. So just generally speaking it's a good PR thing although we don't do it for PR. It's just something that we do and it just happens to be good for what we do.

I ask because I guess a lot of companies are kind of grappling with that - how do you make money and support open source.

It can be tricky. We have a commercial product that is not open source and that is what I work on - our mail server. It's not open source, we plan to keep it that way for the foreseeable future because...

You've got to pay the salaries.

Exactly.

But at the same time we are happy to use open source solutions when we do professional services work. If we do need to modify something, and this is not a hard requirement - we usually suggest to the client that it is in their best interest to release those changes back to the community so that their support burden is reduced, more bugs are found sooner than they otherwise would be. So we feed back to the community that way as well as by sharing what we know at conferences.

Why do you think PHP has been so successful?

I think because it's easy, it's really accessible, it's easy to use. Going back to when I was doing ASP classic programming, something like sending an email, I needed to go and source a third party component to send the mail and then use that component. And then even harder was getting that component installed on the web host. They were a bit resistant to doing that because they didn't want to run random pieces of code especially on Windows. You don't really know what it does, you could bring down the server too if it was badly written and stuff like that.

Install PHP and you have this mail function that just sends you an e-mail. Because it has a low barrier to entry you can easily do some pretty powerful things with it. The language is nice. So comparing it again with ASP classic--VB script is just atrocious if you want to build strings with quotes in. You end up with this big thing ... It's things like that - not really a technical reason, it's kind of aesthetic in a way, but those things do just kind of add up.

There's a serious attempt to keep PHP simple, right?

Yeah, it's one of the driving goals.

And as it's open source, because it is open source it is the way it is, or...does that have any bearing on it?

I think that's very appealing because it's free, it runs on a wide range of platforms, and you can change the way it works if you want to. If it's broken you can fix it or you can try to find someone that knows how to fix it. If something's not there you can plug it in. You can add it in--write an extension to do that kind of stuff. Traditionally it's been difficult because there has been no real reference on that.

I read your section on that topic in Programming PHP, the second edition, just recently released.

Am I credited in that?

You're credited in there with doing the section on extensions.

Oh, that's right. Yes, that's true, I'd completely forgotten all about that. To be honest, all I really did was update that for PHP5. It is still largely the text that Rasmus wrote originally. I didn't really write that section, it was mostly a touch up.

Well you are credited as is Chris [Shiflett] for the section on security.

I haven't seen that book yet actually. I should ask for a copy. I'd completely forgotten all about that. Yeah, so there hasn't really been a reference. That chapter serves as a 50,000 foot view in a way. Sara Goleman's "Extending PHP" book is like gold for anyone who wants to do that sort of thing - a lot of material that has never before been documented, so it's great. Maybe we'll start to see more extensions, which is nice, or more people that can maintain the existing ones.

Yeah, I guess that's half the battle, isn't it. How did you get into doing PDO [PHP Data Objects] if you're not really... I mean I think you say somewhere that you are not a database fan.

Yeah, I don't really like databases. I think partly as a result of doing PDO I get annoyed at databases. All of them have their own little quirks that are just kind of irritating. For me, databases aren't really that interesting either. You put things in and pull things out essentially, that's a real simplistic view - not much more to it. There are of course, because there are issues with replication, making queries run fast, building indexes, all that kind of stuff. So there is a lot in there, but to me personally they are not too interesting.

The reason I did PDO was that I find that making good APIs interesting, and I could see that PHP was really in need of that. That is kind of the reason that I put the effort in on that side. I live and breathe APIs. That's something I do at OmniTI ... I help architect APIs. Based on innovations there, you can then build other cool features.

It's certainly nice to see more uniformity in the API's. You look at the mysqli extension using underscores instead of camel case like PDO...I guess somebody objected to camel case as too Java ...

The only reason that mysqli has underscores is that Georg Richter absolutely refused to name them camel case. It was decided that that would be the standard for OO based extensions going forward, but Georg didn't like that convention.

I wondered about that.

Which is fine. It's his code and he's got to maintain it, so.... But that's one reason it's not so uniform.

That's all I wanted to ask you - thank you very much. Nice to hear your views on open source and PDO.

About the Author

Peter Lavin runs a Web Design/Development firm in Toronto, Canada. He has been published in a number of magazines and online sites, including UnixReview.com, php|architect and International PHP Magazine. He is a contributor to the recently published O'Reilly book, PHP Hacks and is also the author of Object Oriented PHP, published by No Starch Press.

Please do not reproduce this article in whole or part, in any form, without obtaining written permission.