A couple of weeks ago I posted to the OCLC Developer Network and code4lib listservs asking the developer community what their preferred HTTP Client was for PHP. I have been working on code libraries in PHP to make it easier for developers to interact with our web services. These libraries will provide working examples and solve some of the more rote tasks, such as Authentication and Authorization. The first library we are hoping to release will wrap up the functionality for interacting with our Web Service Key (WSKey) API key system.
All of these code libraries have to make HTTP requests and I didn’t want to do this natively using PHP CURL, which isn’t object-oriented. I proposed three possible solutions:
Ultimately the first and third solutions were not popular. Most people were in favor of using an existing code library. However, Zend was considered bulky and onerous to deal with. Two alternative HTTP Client libraries were suggested:
I’d looked at PEAR’s HTTP_Request2 as part of my initial review but somehow had missed Guzzle. Since Guzzle was recommended by multiple members of the community I decided to do a deeper dive and look at it in more depth. Ultimately after my review I chose to re-implement my HTTP calls using Guzzle.
Now that I’ve settled on using Guzzle to power the HTTP request part of my code libraries, I’m incorporating it into the code base. Ultimately this means changing 50 to 60 lines of code in three different files and testing the functionality. Because I need the trunk code to still work (I use it for testing all the time), I’ve cut a branch to work in. Once the work is completed and tested, I can merge the changes back into trunk. The next step will be getting the authorization and authentication classes ready for release. This means
You can see from this list there is still a lot of work to be done. Many of these tasks I’ve never actually done before. While I’m excited to get to learn about these things, it will slow the process down a bit. Additionally, I’m about to go away on maternity leave! This project will be my focus when I return in late November and our hope is to get things released around the first of the year. Watch this space – we’ll update you on our progress as we get closer to releasing these libraries.
The OCLC Developer Network supports the use of OCLC Web Services—a set of tools and APIs that expose data and services for WorldCat and our member libraries and partner institutions or companies. learn more »
© 2010 OCLC Domestic and international trademarks and/or service marks of OCLC Online Computer Library Center, Inc. and its affiliates