This website recently got a major rebuild; if you're missing something, let Lorna know.

    Category: php


  1. PHP North West 2011


    We might still be in the thick of the summer conference season, but there's an event coming up this autumn which has me very excited: PHP North West 2011.

    This is a regional PHP conference based in Manchester, UK, and I've been involved with it since it began (I'm surprised to find this is our fourth edition, it still feels like a shiny new adventure!). This year the dates are 8th and 9th of October and with an added tutorial day on the Friday, it is bigger (and of course better) than ever. In case you missed the announcements, here are the main things you need to know:

    Read more

  2. PHP|Tek and a Hackathon


    A couple of weeks ago I had the pleasure of speaking at php|tek in Chicago. As usual there were a few great talks, a good crowd of new folk and a selection of established speakers all at the event and I had a great time. This year, there was one particular highlight that I wanted to share: the hackathon.

    Read more

  3. PHP OAuth Provider: Authenticate User


    I've been working with OAuth, as a provider and consumer, and there isn't a lot of documentation around it for PHP at the moment so I thought I'd share my experience in this series of articles. This relates to the stable OAuth 1.0a spec, however OAuth2 has already started to be adopted (and differs greatly). This article uses the pecl_oauth extension and builds on Rasmus' OAuth Provider post. This post is the third in the series, following on from the ones about the initial requirements and how to how to handle request tokens.

    This phase is probably the most familiar to us as developers, as it's simply a login form. The consumer will send the user to us at the URL we provided in the request token, and the user will have the request token key as a parameter. The access control on this page will look the same as on the rest of the website; if the user has a session already then the page is displayed, otherwise they must be logged in to see it.

    Read more

  4. PHP OAuth Provider: Request Tokens


    I've been working with OAuth, as a provider and consumer, and there isn't a lot of documentation around it for PHP at the moment so I thought I'd share my experience in this series of articles. This relates to the stable OAuth 1.0a spec, however OAuth2 has already started to be adopted (and differs greatly). This article uses the pecl_oauth extension and builds on Rasmus' OAuth Provider post.

    The consumer requests a request token (see my earlier post about consuming OAuth), and as a provider, we need to handle that request. In my example, I chose to pass the variables as GET parameters, but you could adapt this to handle POST variables or information contained in HTTP headers.

    Read more

  5. A Prototype API for Joind.In


    Following the principle of "release early, release often", I put live a very early version of the v2 API for joind.in today (so that I can use it in another project!). I haven't updated the documentation yet but in case anyone was thinking of consuming data from joind.in …

    Read more

  6. Idiot-Proof Deployment with Phing


    disclaimer: I am not underestimating the universe's ability to produce idiots, the point I'm trying to make is that I haven't managed to make any deploy mistakes using this approach. Yet.

    Once upon a time, a long time ago, I went onto a conference stage for the very first time and said that I thought I might be the world's ditsiest PHP developer. I actually still think that is pretty true, and if you work with me then you will know that I mostly break and fix things in approximately equal measure. With this in mind, when I launched my own product recently (BiteStats, a thing to automatically email you a summary of your analytics stats every month), I knew that I would need a really robust way of deploying code. I've been doing a few different things for a few years, and I've often implemented these tools with or for other organisations, but I don't have much code in production in my own right, weirdly. I decided Phing was the way to go, got it installed, and worked out what to do next.

    Read more

  7. PHP OAuth Provider: Initial Requirements


    I've been working with OAuth, as a provider and consumer, and there isn't a lot of documentation around it for PHP at the moment so I'm sharing my experience in this series of articles. This relates to the stable OAuth 1.0a spec, however OAuth2 has already started to be adopted (and differs greatly). This article uses the pecl_oauth extension and builds on Rasmus' OAuth Provider post.

    Read more

  8. PHPComCon Web Services Tutorial


    If you are attending my Web Services tutorial at PHP Community Conference (if not, probably nothing for you to see here) later this week then you might like to download the sample code. I'll be referring to this and inviting you to "play along" as I go creating services during …

    Read more

  9. Script for Database Patching at Deploy Time


    I've written before about a simple way of patching database versions and there's a much more comprehensive article from Harrie on TechPortal as well. I often find though that projects with patching strategies are missing the scripts to apply these automatically when the code is deployed, so I thought I'd share mine.

    My current project (BiteStats, a simple report of your google analytics data) uses a basic system where there are numbered patches, and a patch_history table with a row for every patch that was run, showing the version number and a timestamp. When I deploy the code to production, I have a script that runs automatically to apply the patches.

    Read more

  10. Invalid Protected Resource URL in Pecl_Oauth


    I had a funny (funny weird, not funny haha) problem the other day when working with pecl_oauth in PHP to talk to a service. I'd gone through all the handshaking steps, got the acces token and was ready to start talking to the service itself. However when I tried to …

    Read more

  11. Downgrading a PECL Module


    Recently I saw some weirdness in an existing application when I upgraded a PECL module that the application depended on. To figure out if that really was the problem, I wanted to downgrade the module to its previous version. There is no opposite command to "upgrade" but you can instruct …

    Read more

  12. Summer PHP Conferences


    Conference season approaches and in May I'm on a trip to take in two of the most high-profile events in the PHP conference calendar: DPC in Amsterdam (19-21 May) and php|tek in Chicago (24-27 May). The two events have historically been a few weeks apart and I've always complained at having all the fun for the year in such a short space of time - but this year the events are literally back-to-back, there are a small number of speakers attending both and we're pretty much all on the same flight from Amsterdam to Chicago!

    Read more

11 of 27