-
A Freemium Business Model
22 February 2012
Read moreI have an android smartphone, and I have *very* few paid for applications on it. Mostly I have document viewers, the wordpress app, mail/calendar/map from google, and so on - plus a couple of free games. In January I downloaded a new game and I've been playing it pretty regularly since*.
-
Wedding Stationery
20 February 2012
Read moreIn case you missed it, ours was a small wedding - which means that the majority of our friends and family weren't actually there! We loved our small wedding but I knew that I still wanted to share a small flavour of the day with some of those friends and family, and also get some mementos for our home.
When browsing the moo.com site (it is usually best to hide all payment cards out of reach before doing this!) I had seen the postcards that they make and decided this would be a great way to send a small selection of photos to a few people. Once we got the "official" photos in, I ordered some postcards, and I think they turned out rather well!
-
Upcoming PHP Courses
16 February 2012
Read more
Since becoming freelance 18 months ago, I've taught a number of courses at my excellent local tech training centre, NTI Leeds. Over the next few months we're running some one-day PHP courses (see my course dates page for more detail and the dates, all these are in Leeds although I'd like to run them elsewhere too), targeted at a particular area or set of skills. These are areas that I find myself delivering consultancy or training on frequently, or things I teach when I go places and realise these gaps exist in their knowledge. Does this match your experiences of "things I wish PHP developers knew - including me"? -
Wordpress Contact Form 7 Without Captcha
15 February 2012
Read moreWhen this blog moved to wordpress, we added a contact form into the footer, which was available on every page. This seems awesome until you see the sheer volume of spam I got from it in the first day or two. I hate captchas, not least because I usually fail them at least once myself, so I was in search of alternatives and found two: akismet and the honeypot plugin.
-
My Winter Wedding
13 February 2012
Read moreAlthough I usually write only about technology on this blog, it's still a personal site and I have some news that I absolutely must share: I got married!!!! I've been waiting for the official photos before I wrote this post ("pics or it didn't happen", as the saying goes) so here is the evidence:
-
Google OAuth 403 Response
09 February 2012
Read moreI had an issue this week on a system which has been working fine for a while, but stopped fetching some data from google's user account API. I was getting a 403 response from the API, which seemed odd. Luckily I was logging OAuth::getLastResponse() to my error logs (this …
-
Speaking at DayCamp for Developers
07 February 2012
Read moreI am delighted to announce that I'm speaking at the upcoming DayCamp for Developers in early March. The idea behind the daycamps is to bring important but non-technical skills to developers everywhere - so the sessions are virtual and so are the speakers! This time around the topic is Business, so …
-
Mercurial "Not At A Branch Head" Error
06 February 2012
Read moreAlthough I write and speak a lot about various kinds of source control (git and subversion are the most popular still as far as I can see), my own development projects are on BitBucket under mercurial (bitbucket also offer git hosting these days, and their tools are great). Recently I was working on an upgrade for BiteStats (note shiny new theme, with thanks to @miss_jwo) and I kept getting this error from hg tag
not at a branch head
-
Building a RESTful PHP Server: Output Handlers
01 February 2012
Read moreThis is the third installment in my series about writing a RESTful web service in PHP (the previous entries are about understanding the request and routing it. It is probably the last one but there are a few other things I'd like to cover such as error handling, so I might keep adding to it, especially if I get any particular requests or interesting questions in the comments. So far we've covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way.
-
PHP 5.4 Built In Webserver
30 January 2012
Read moreOne of the big features arriving with PHP 5.4 is the addition of a built-in basic webserver for use in development environments. Quite a few of the other scripting languages have something like this so I'm very pleased to see it in PHP. Using a server like this makes it easy to quickly try out some scripts without needing to configure apache or really do anything much! I had to look up a few things to get started, so I thought I'd write them down for posterity.
-
Building A RESTful PHP Server: Routing the Request
23 January 2012
Read moreThis is the second part of a series, showing how you might write a RESTful API using PHP. This part covers the routing, autoloading, and controller code for the service, and follows on from the first installment which showed how to parse the incoming request to get all the information …
-
Building A RESTful PHP Server: Understanding the Request
19 January 2012
Read moreOnce upon a time, what seems like a lifetime ago, I was away for a couple of weeks, and I wrote a series of posts about serving RESTful APIs from PHP to keep my blog going while I was away. Fast forward a few years and those posts are outdated and still wildly popular - so I thought it was about time I revisited this and showed how I'm writing RESTful PHP servers today!
In the first part of this (probably) 3-part series, we'll begin with the basics. It might seem boring, but the most important thing to get right with REST is parsing all the various elements of the HTTP request and responding accordingly. I've put in code samples from from a small-scale toy project I created to make me think about the steps involved (should I put the code somewhere so you can see it? Let me know). Without further ado, let's dive in and begin by sending all requests through one bootstrap script:

