PHP

Benchmarking magic

Submitted by Larry on 4 November 2007 - 12:38am

The day is nearly upon us! Drupal 7 will open up developers to PHP 5 functionality when it is released next year. Already, there is talk of how, and if, to leverage PHP 5's object handling now that we don't need to deal with the weirdness of PHP 4's object model. Of course, because it's Drupal, our army of performance czars want to know just what the cost is for object handling, and especially advanced object magic like __get(), __call(), the ArrayAccess interface, and so forth.

So let's find out. :-)

Good SPL intro

Submitted by Larry on 2 October 2007 - 9:20pm

One of PHP 5's coolest features is the Standard PHP Library, or SPL. If you're operating in an OO way, SPL is a great way to easily leverage a huge amount of functionality.

Of course, the main problem is that the official documentation on it sucks. At best it points to an off-site series of class hierarchies. (Technically it's not off-site, but not internal to the manual.)

DrupalCon Barcelona: Best DrupalCon Ever!

Submitted by Larry on 2 October 2007 - 12:43am

So it's been a week since DrupalCon, which means I'm kinda sorta caught up enough to write about it. Hooray!

As with DrupalCon Sunnyvale, I came away with one conclusion fixed in my mind: The Community is Drupal's greatest strength. Virtually everyone upholds a strong community and open source spirit, and will gladly talk to you for hours about subjects both on topic and off, with or without beer (free or otherwise).

But enough about how cool we are. On with the rundown.

Abstracting databases

Submitted by Larry on 30 August 2007 - 1:03am

There has been some discussion recently, in IRC, issue queues, and blogs, about the Drupal 7 database API and its impact on supporting different database engines. While I am still trying to avoid large amounts of public distraction, especially when we're supposed to be trying to get a Drupal 6 beta 1 out the door, I feel it's important to get a few points cleared up lest they lead to confusion later.

Magical PHP: __call()

Submitted by Larry on 21 August 2007 - 11:35pm

PHP is, conceptually, a very traditional language. By that I mean that it is steeped in the C/C++/Java mindset of how a program is put together, rather than the LISP/Javascript/Ruby/Python mindset. That's not a bad thing, necessarily, but it does mean that a lot of the cool dynamic language capabilities in those languages isn't really available to PHP developers. I freely admit to being jealous of functions as first-class objects, for instance.

PHP 5, however does include lots of "magic" capabilities, some in the object model directly and some via SPL Interfaces, that, if used properly, can make up for a lot of that lack of dynamic capaibility. A favorite of mine is the ability to add methods to a class at runtime.

What? You didn't know PHP can do that? Well, that's because it can't. However, we can simulate it pretty closely if we're careful. Let's see how.

Palantir.net is hiring

Submitted by Larry on 17 August 2007 - 6:19pm

Are you tired of hearing me talk yet? If not, why not come work for Palantir.net? We're looking for a PHP/Drupal programmer and a web developer/themer. Benefits include a full time position at a small business in Chicago, working on sites for higher education, not-for-profits, and other non-evil clients, a company issue Nerf gun, and access to the company Wii. And getting to work with Larry! Who could ask for a better job?

Go PHP 5, Go!

Submitted by Larry on 5 July 2007 - 1:09am

Go PHP 5!

"Never believe that a few caring people can't change the world. For, indeed, that's all who ever have." --Margaret Mead

A while back, various people were lamenting the state of PHP 5 adoption, myself included. What to do about it? How to get hosts to let programmers leverage the added functionality that PHP 5 offers? How can we do that without cutting off 80% of our user base?

The solution a few people suggested was team work. If all PHP projects stopped supporting PHP 4 and made the jump to PHP 5 at the same time, none of them is penalized in the market for being "first" and web hosts will have a clear business case to upgrade their systems to PHP 5. We can then all start offering faster, cleaner, more powerful, more secure web software.

But how does one get all PHP projects together to agree on something like that? Actually, it's fairly simple. You ask them.