Garfieldtech

Technical thoughts, tutorials, and musings

Blog

Drupalcon rocks even more than Drupal, and how to make PHP 5 happen

Posted:

So I'm back from OSCMS 2007, and it was a blast. I'll provide a more complete (and illustrated) writeup later, but for now suffice to say that Drupal developers are by and large totally cool people on top of being very smart cookies.

A lot of people have been blogging about PHP 5, too, and how Drupal needs to move to it or keep PHP 4 compatibility or whatever. One of the most important things to come out of this Drupalcon, as far as I'm concerned, is that I think we really do have a picture of how we can make it happen.

Washington University, St. Louis goes Drupal

Posted:

It's a somewhat belated announcement, but I am pleased to report the latest Drupal site on the Net, Washington University, St. Louis' College of Liberal Arts and Sciences.

ArtSci is the first major Drupal site for Palantir.net, although we have several more in the pipeline. It is also one of many that Washington University will be launching. The entire Arts and Sciences school has decided to go Drupal. Yay for Open Source!

MVC vs. PAC

Posted:

One of the most common mistakes I see people make when talking about web architecture is with regards to MVC. Generally it comes down to a statement such as this:

It's a web app, so we have to use MVC. That way we separate the logic and presentation, which means keeping PHP out of our display layer. All the important projects do it that way.

Of course, such a statement is false. It demonstrates a lack of understanding about MVC, about web applications, about "important projects", and about software architecture in general. Let's try to clarify, with a little help from Wikipedia.

Merlin the Amazing

Posted:

I make no secret about the fact that I am a fan of Free and Open Source software. There are many reasons. The quality of the code tends to be better. I like to tinker with it and see how it works. It's usually gratis as well as [Free|Open]. But what really makes Open Source so attractive as both a user and a developer is talking to merlinofchaos.

Simplifying SQL

Posted:

Most PHP applications do fundamentally the same thing: Shuffle data from an SQL database to a web page and back again. The details vary with the application, but in general that's what most web apps do. That very quickly runs into the bane of most PHP developers' lives: SQL syntax.

It's not SQL syntax itself that is bad per se. The problem is that it is a string-serialized format, which means you have to take your nice clean data structures and serialize them out into a string that has no semantic meaning to your PHP application. That's boring, dull, and introduces all sorts of places to totally mess up your application with a typo, and that's without even touching on issues of security. And then there are the issues with SQL syntax itself, in particular the way in which INSERT and UPDATE statements, which seem like they should be similar, have no similarity whatsoever. That makes "replace" operations (insert if new or update if not) very tedious to write, particularly if you have a lot of fields.

Fortunately, with a little ingenuity and help from PHP's array handling, we can give ourselves a common syntax for INSERT and UPDATE operations that maintains semantic meaning, and then get DELETE statements free of charge. Let's see how.

A blog reborn

Posted:

As both of my avid readers have likely noticed, this blog has not been particularly active of late. That is to say, today is the one year anniversary of the last time it was actually used. :-) So what do I do to celebrate? Rebuild the whole thing from scratch, of course!