Using JIRA’s REST API to Create a Dashboard

If you read this blog often, you’ll know that I am:

  • crazy about APIs
  • living with some accessibility issues

Put these two things together and what do you get? Actually don’t answer that! Today what you get is an example of integrating with JIRA’s REST API, because their recent “upgrade” locked me out of the issue listings pages completely and I really do need to be able to see a list of bugs! Their bug editing screen is quite usable, so it’s just the list that I need here, but you could easily call their other API methods as you need to. Continue reading

Speaking at Leeds PHP

On Monday 19th March I’ll be speaking at PHP Leeds. The topic is all things git and github; as an open source project lead I see lots of very capable programmers taking their first steps with github. In this session we’ll talk about how you can use these tools to contribute to open source (or your own projects, of course), covering both “what to click in the web interface” and “what to type at the command line” for git and github respectively. Come along if you want to know more about git, open source, or github!

Upcoming PHP Courses

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”? Continue reading

Building a RESTful PHP Server: Output Handlers

This 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. Continue reading

PHP 5.4 Built In Webserver

One 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. Continue reading

Building A RESTful PHP Server: Understanding the Request

Once 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: Continue reading