Craig Marvelley

Software and such

Box UK, Open Source Software and PHP

Over the last couple of weeks I’ve been involved in a new initiative at Box UK to package and release some of our code under an open source license. This decision stemmed from some conversations I had with fellow developers at the PHPNW 2010 conference, ┬áspecifically relating to dependency injection and how it can be useful in larger PHP applications. People seemed interested in the DI container solution developed for Amaxus using features introduced to PHP in the 5.3┬árelease, so we decided to make both that and a thumbnailing library available to the wider community in the hope that they may prove useful.

More can be read about boxuk-di, the dependency injection library, on this page. The article outlines some of the nifty features of the library, such as using reflection to achieve automatic dependency resolution, doing away with the configuration files commonly found in DI solutions. The code itself is available at BoxUK’s github page. It’s pretty cool, and makes creating objects with loads of dependencies a breeze.

The second library, Obscura, is a wrapper for PHP’s GD library that aims to make it easy to do image thumbnailing using an object oriented approach. I wrote the library earlier in the year, and it’s currently used in the Amaxus CMS. It’s still in its infancy, and there’s plenty I hope to add to it in the near future (like cropping and watermarking) but as a simple thumbnailer it does the job. I don’t know of too many thumbnailers for PHP with such a permissive license, which was the driving force behind my desire to write this one. More details can be found at Box UK’s website, while again the code can be found at the company’s github repository.

Hopefully there’ll be more to come if these initial releases prove successful. I’m glad to have been involved in the project, as it’s helped alleviate some of my guilt at using so many excellent open source tools but, until now, not giving anything back. I’m aiming to release some of my own code in a similar fashion in the near future.