LAMP and Beyond, 30th June in Manchester

Just wanted to share news of an event that I'll be at in a couple of weeks: LAMP and Beyond. This event is organised by PHPNW and held at Madlab in Manchester on June 30th (it's a Saturday).

The idea is that we bring together a bunch of interested developers plus a few people who know something about some of the technologies which are often used with LAMP but aren't part of the acronym - and work on ... whatever you want to work on! Between us we'll be able to advise on choosing and implementing new technologies for solving particular problems, troubleshoot some sticky issues, and maybe whip up some new projects to give you a chance to play with something new and shiny!

If you want to join, you can get tickets (but be quick, there aren't many left) on eventbrite: http://lampandbeyond.eventbrite.com/ - see you there!

Proof that PHP 5.4 is Twice as Fast as PHP 5.3

So recently I was working on some benchmarks for different versions of PHP, because I heard that PHP 5.4 is "faster" and since I'm a data geek I want to know how much faster! Now, PHP 5.4 is, in general, faster than PHP 5.3 but not twice as fast* unless you pick a use case which has been particularly optimised.

My first attempt at benchmarking the two versions produced this:

graph showing php 5.4 taking half the time of php 5.3
Continue reading

Fetching Your Talks from the Joind.In API

I'm a regular speaker at a variety of (okay, mostly technical, so not really that varied!) events, and I submit talks to many CfPs (calls for papers). Whenever this happens, I tend to look back at whether I have any existing talks that I gave and liked and which would be a good fit. I use my joind.in speaker page for this: http://joind.in/user/view/110 as it's simpler than dredging through my directory of talks/articles on my hard drive (this is now rather large and unmanageable!).

I've recently been thinking that I should also do a better job of linking through to the various talks I'm giving/have given - and at around the same time I was contacted by the good folk at mojoLive about integrating against joind.in. To cut a long story short, the joind.in API now has the functionality for users to retrieve their list of talks! Continue reading

PHP Recursive Function Example: Factorial Numbers

I spun up the simplest example I could think of to illustrate a recursive function to a PHP beginner the other day, and I thought I'd share. I often don't post really basic content but I should - people are beginning to be beginners all the time, after all!

Factorials

Factorials are a very easy maths concept. They are written like 5! and this means 5 * 4 * 3 * 2 * 1. So 6! is 720 and 4! is 24.

6! is the same as 6 * 5!, or 6 * 5 * 4! ... and this is where the recursive functions come in. Continue reading

Speaking at OSCON 2012

In July, I'm speaking at OSCON. Actually I have a few interesting speaking engagements coming up, and I haven't got around to adding upcoming dates to my blog yet but I'll be at phpDay in Verona next week with a talk on API Design and DPC in Amsterdam in June with a tutorial on Web Services and a talk on what OAuth is actually for.

OSCON is special because I have always wanted to go and never imagined it would actually happen. Every year I read the list of sessions from the year before, and decide that I absolutely must submit to the call for papers, regardless of how small I think my chances of being accepted are! I've submitted a couple of times in the past, excluding last year because I was newly freelance (OSCON does not cover any speaker expenses at all, they just give you a conference pass. That's kind of hard going for those of us self-funding halfway across the world, and last year, I just couldn't do it. This year I still can't really justify it but I'm going anyway!) Continue reading

Using an Existing Vagrant Setup for PHP Development

I've been hearing great things about puppet, chef, vagrant, and friends for a while now, but since I work on my own I tend to either develop straight onto my ubuntu machine or grab an appropriate existing VM and use that. So I read about this brave new world of virtualisation but (as with most tools) they can be hard to introduce on your own, and I didn't.

Then I went to WhiskyWeb, which had a hackathon. I'm unclear on exactly what happened because my attention was elsewhere but it seems like @JayTaph showed off puppet and vagrant to @deizel*, who immediately built a vagrant setup for joind.in, which is an open source project that I'm currently leading. With the shiny new technology all packaged for me, I decided it was time to take a look! Continue reading

We Don't Know Deployment: A 4-Step Remedy

Someone emailed me recently, having read my book and wanting some advice. Here's a snippet of his email:


So here's my problem.
We dont know deployment. We work from same copy on one test server through ftp and then upload live on FTP.

We have some small projects and some big collaborative projects.

We host all these projects on our local shared computer which we call test server.
All guys take code from it and return it there. We show our work to clients on that machine and then upload that work to live ftp.

Do you think this is a good scenario or do we make this machine a dev server and introduce a staging server for some projects as well?

I wrote him a reply with some suggestions (and my consulting rate) attached, and we had a little email exchange about some improvements that could fit in with the existing setup, both of the hardware and of the team skills. Then I started to think ... he probably isn't the only person who is wondering if there's a better way. So here's my advice, now with pictures! Continue reading

Book Review: MongoDB and PHP

Despite having been toying with MongoDB and PHP for quite a while, I've only just picked up and read the "MongoDB and PHP" by Steve Francia, published by O'Reilly (disclaimer: I've collaborated with Steve on a few articles and he sent me a copy of the book to read)

Continue reading

Using OAuth2 for Google APIs with PHP

I've been working on something recently where I'm pulling information from lots of places onto a dashboard. Each API has its own little quirks so I'm trying to write up the ones that weren't idiot-proof, mostly so I can refer back to them later when I need to maintain my system!

I've written about Google and OAuth before, but that was OAuth v1.0, and they are introducing OAuth2 for their newer APIs; in this example I was identifying myself in order to use the Google Plus API (which turns out not to do anything you'd expect it to do, but that's a whole separate blog post!). Continue reading