PHP Code Style
I recently decided I wanted to apply the PSR-2 strict coding style to my existing PHP code and classes and as result surprised myself how quickly I was able to adopt it naturally in the new code I was writing once I had some similar configuration set across text editors.
Blogging
After a small amount of deliberation I've decided to put the latest version of my personal blog live again. You may notice a change in the front-end which I initially started work on over a year ago! The blog is the same as before, in that it is a custom built web application using my own MVC components together with Smarty but in the latest version the inner dependencies are managed using Composer. These components are still in the pre-release stages of development but watch this space.
ELib and Twitter
I've been working on a PHP library that can sit alongside Empathy (lightweight MVC) on a purely non-dependant way. The idea being that some of my semi-duplicate code across projects can be re-factored into a central toolkit.Instead of dealing with the boring re-factoring straight away I wanted to work on a simple PHP library for making calls to the Twitter Api (excluding the search API so far). What I think I've ended up with is potentially a nice utility for accessing any REST-ful API with a clean way of defining the API 'specification', perhaps with little-to-no performance hit.I didn't want to look at any existing offerings of PHP library to make it more enjoyable while I pondered an elegant solution of my own. In a fairly paradoxical fashion (as is often the case) the main features revealed themselves in reverse order. I started by building a static array, which could contain the specification of the public API. By doing so I forced myself to consider (sometimes subconciously) the different logic that might be involved in ensuring each variety of call could be easily accessed with a standard interface. Eventually it occured to me that a typical call from a web app might look like this:
$t->doCall('url/to/call/'.$id,
array( 'param1' => $value1, 'param2 => $value2),