a work on process

Viewing posts tagged: PHP

Available for projects

7 November 2007 (4:06 pm)

By James Stewart
Filed under: Announcements, Meta
Tagged: , , , , ,

With a few projects coming to an end it turns out I have some time on my hands that I could do with filling with some paying work. I’m an experienced web developer, having been building sites and applications for eleven or twelve years now. I prefer to work with Ruby on Rails, and have been doing so for two years, but am comfortable in a range of environments and want my tools to match the project as well as possible. I frequently find myself working with drupal, and as an eight-year PHP veteran, that’s okay.

I’m particularly passionate about helping charities, music organisations, and magazine publishers make use of the web as effectively as possible. I can help such organisations work out how what they do in other environments translates to the web, and then to build the tools to make that happen. I prefer nuance to buzzwords, but I can throw around the appropriate Web 2.0 terms if I have to.

(and if you don’t fit in that list but have a project you think I might find interesting, I’m still interested in hearing from you)

I’m used to working solo, or in a small team, and have experience of leading teams as well as being a member. I’d prefer something in or around London, but usually work from home and am quite open to remote working.

I’ve got three, or maybe four days available for the next couple of months. You can reach me at james@jystewart.net to find out more.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Book Review: PHP Web 2.0 Mashup Projects

28 October 2007 (12:00 pm)

By James Stewart
Filed under: Book Reviews
Tagged: , , , , , , , ,

The market for books about mashups has become fairly crowded over the past few years but none have really enticed me as from a casual look most seem more interested in following the trend than offering solid information. Thankfully PHP Web 2.0 Mashup Projects manages to slide in a good number of practical programming tips as it works its way through a variety of services.

The book dedicates the majority of each chapter to more general concerns than just interfacing with the system in the chapter’s title. So Chapter 2—”Buy It On Amazon”—spends most of its time exploring XML-RPC and REST approaches and building tools to work with those different styles of interface. Similarly the next chapter spends most of its time introducing WSDL, XML Schema and SOAP before showing how they can be used with Microsoft Live Search.

In fact, that chapter may be one of the best introductions I’ve seen for developers who need to quickly grasp the basics of WSDL and SOAP, a topic that can far too easily get bogged down in complexity that isn’t needed for basic usage. With the WS-* stack quickly and for good reason going out of fashion hopefully most developers won’t have to spend much time with it, but a simple overview is still very handy.

I was intrigued to see the final chapter diving into use of RDF with the RAP toolkit. Like the SOAP section, this managed to boil the basics of RDF down very well and should help most moderately experienced PHP developers to get up to speed quickly.

Aside from a closing section on race conditions, not much time is given to handling interruptions in service from third-party services and in a book focussed on mashups that’s disappointing, particularly as the number of services, and so the range of fallback options, is increasing. Some of the examples are likely to fail if services time out and it would be good to spend some time on helping developers avoid that.

Reading the book as someone who has mostly left the PHP fold for pastures new was a reminder of how easy tools like hpricot make life for screen scrapers, but also that good structure can emerge in PHP code and that the SOAP tools are actually quite good for simple uses. The book is unlikely to appeal to those who don’t do much work with PHP, but if you’re a PHP developer and want to dive into mashups and web services for the first time, it’s worth a look.

Disclaimer: I was sent a copy of this book for review by the publisher, and offered another in return for a timely review. You can find it at packt, amazon US, amazon UK and all sorts of other places.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

A couple of releases

9 April 2007 (9:59 am)

By James Stewart
Filed under: Announcements
Tagged: , , , , , ,

In the process of catching up with some neglected tasks, I’ve pushed out new releases of both of my PEAR packages.

Services_Technorati receives a version number bump, and little else. The alpha release was never meant to last quite this long given that it’s merely a port of a very stable package, and it’s finally marked beta. My hope is that the beta release will pick up a few more users to put it through its paces.

I had wondered about adding in some extra classes to encapsulate responses, but at the end of the day simplexml does a decent job, is well documented, and doesn’t add any overhead, so I’m happy just returning its objects and letting people work with them.

There are also a couple of bug fixes for the stable release of XML_Feed_Parser, kindly contributed by users. There are still a couple of outstanding tickets, but they’re issues which require more thought so I’m postponing them for 1.0.3 or 1.1.0.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Services_Technorati version 2

23 February 2007 (10:51 am)

By James Stewart
Filed under: Announcements
Tagged: , , , , , ,

In an effort to tidy up various older projects that were never quite completed, I’ve turned my attention to my first PEAR module Services_Technorati. It’s a very simple wrapper around the Technorati API, but the PHP4 version never reached a stable release as it depended on some other packages which were also never stabilised.

So it seemed time to make the simple step of converting the code to be PHP5-only and use simplexml for their XML parsing. That removes the dependencies which were slowing me down, and should result in improved speed along the way as the XML parsing is now handled in C rather than PHP. I just released 2.0.0alpha1, but the code should be pretty stable and I’m hoping to run through the steps and get a stable release out very soon.

Update (27th Feb): I’ve just pulled this release and re-released it as 0.7.0. Apparently because the package never release 1.0 in its original version, I should just continue with the previous version numbers despite the change to PHP5.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Extending drupal’s checkout process

18 February 2007 (9:33 am)

By James Stewart
Filed under: Snippets
Tagged: , , , , ,

In yesterday’s post on creating custom product types in drupal I promised a follow up on how we were adding the license generation to our checkout. I’m not going to go through all the steps in great detail as most of what I wrote is specific to our situation, and the custom PHP module (written in C) that generates our licenses, but it took me a while to work out how to hook in, so here are a few words.

In addition to our custom product type module ‘licensable’, I also wrote a module called ‘licenses’ which allows the site administrator to specify types of licenses to go with specific products and generate licenses, and for users to review the licenses they’ve bought through their account. It’s in that module that I connected with the transaction API to generate licenses after a purchase.

The callback in question is ‘hook_ec_transactionapi’ and we needed to intercept the ‘update’ operation:

function licenses_ec_transactionapi($txn, $op, $a3, $a4) {
    switch ($op) {
        case 'update':
            if ($txn->payment_status == 2) {
                licenses_generate_license($txn);
            }
            break;
    }
    return true;
}

A payment_status of 2 means that the payment has been completed and we can generate the license. The ‘licenses_generate_license’ function can then loop through the transaction’s products and generate licenses for any that are licensable. Some rough code for that would be:

function licenses_generate_license(&$transaction) {
  $user = user_load(array('uid' => $transaction->uid));
 
  foreach($transaction->items as &$product) {
    if ($product->ptype == 'licensable') {
      // generate license
    }
  }
 
  // send email to user with their license details
}

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 
« Previous PageNext Page »