Blog

I could use a REST from ModRewrite

I won't enthuse about the virtues of web-services and especially REST - many people have written great articles and presentations before me :-)

One problem irked me: delivering different content on the same URL using a framework.

I'm building a system which stores data about a company.
You visit company/20 and you get a page with data about company 20.
You POST to company/20 and the system saves the new data.

This can make your controller a little fugly:

<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  $this->_saveCompany();
}
else {
  $this->_viewCompany();
}

Drupal and Varnish - a quick intro

Varnish is a HTTP accelerator (or reverse proxy) capable of serving 100,000 requests a second. Somewhat faster than Drupal, even with page-caching on!

How does it work?

Diagram of the varnish process, explained in more detail in the list below.

Panels magic

I love unexpected discoveries.

Drupal's Panels module seems to find its way into most of my site builds, along with custom layouts, panel-panes and all sorts of goodness.

I used to declare custom panel layouts this way:

Drupal and the spirit of openness

So what does it take to get accepted around here?
I've started this post to kick off a discussion about the Drupal database abstraction layer, and how to encourage support for other databases.

Overriding language for a Drupal backend

Someone in my DPC Drupal tutorial brought up the topic of multi-lingual sites, and asked how to run the backend of the site in English, when the frontend is in Dutch...

Text in Drupal should run through the t() function, which handles translation. t() checks the global $language variable to choose the target language ($language may be set from user preferences, from a path parameter, from content-negotiation...it will be set automatically).

The solution is to implement an early bootstrap hook - hook_init - to change the language.

Getting Antsy with Phing

Earlier today, I set to work on an open source project...pulled down a copy from github, and started reading through the code.

And there I found a build.xml file.

At first I didn't think anything of it - plenty of my projects have ended up using Ant for setup, builds, CI and other myriad tasks.

Developing and testing against live

I usually develop locally on a VM. I generally have more confidence if I'm developing on a platform which is as much like live as possible - and this usually means copying the live database to my local dev environment.

Jumpin Camp technology review

After returning from Jumpin Camp I ended up diving straight into the whirlwind of a site launch...two weeks on I've had the time to collect my thoughts, so now feels like the time to talk about some of the technology we encountered.

JumpIn Camp progress

We're in the final day of JumpIn Camp, and the last two days have been a whirlwind of coding, with some great results.

Agavi, phpBB, Doctrine, osCommerce, cakePHP, Drupal and X-Debug have all been pulled apart, stuck back together, hacked and patched to make them work with Azure and take advantage of the native interfaces such as Azure SQL and Azure storage.

Jumping in with Microsoft

Tomorrow I'll be going to Zurich to join Microsoft at their JumpIn Camp.

It's become a cliche to bash Microsoft, and not too long ago I'd have probably joined in. But these days, it feels like change is in the air, bring the heady fragrances of community, openness, and innovation...all very exciting.

Pages

Subscribe to Blog