Category Archives: PHP

BDD PHP phpspec TDD Testing

Add value to legacy code using agile tools

Working with legacy code need not be the nightmare it is often portrayed as. Tools that are considered best practice for greenfield development can and should be used to support legacy codebases, and prepare them for new development to begin.

read more »

PHP phpspec Testing

phpspec keeps your privates hidden

For the last few days I’ve been using phpspec to build an application. Inevitably comparisons will be drawn between phpspec and PHPUnit, but I think that one clear distinction is found by considering how phpspec prevents the direct testing of a private method. read more »

PHP phpspec TDD Testing

Considering what to test with phpspec

I have recently started using phpspec in place of PHPUnit as a PHP development tool. So far for me, the transition from TDD to specBDD is a fairly trivial one. The vocabulary used in the specs is slightly different to xUnit tools, and this seems to make me think more carefully about what I really want to test, or better, what behaviour I want my object to exhibit. read more »

Doctrine PHP Tutorial Zend Framework

Setting up Doctrine with Zend Framework 2

For this post I am working though Jason Grimes’s article, which in turn is based on Rob Allen’s Album tutorial. The goal is to set up The Doctrine ORM module in Zend Framework 2, and get it working with a simple example. read more »

PHP Zend Framework

Exploring SOAP in Zend Framework 2

At work we have designed a collection of SOAP services using ZF1. This has been great fun, and I’ve learned a lot considering that I hadn’t ever seen a WSDL before May this year. Now though, ZF2 is stable, and after hearing a lot about it at PHPNW I’ve been eager to try it. Rather than waiting for someone else to figure out the differences in the SOAP implementation for me, I’ve decided to jump in myself and learn about ZF2 on the way.

I spoke briefly about this to @Akrabat at PHPNW12, and he has set me down the path of intercepting the bootstrap phase to run the soap server before an action controller gets created.

I’ll be posting my findings here as I make progress, but welcome any input from anyone who has already done work with SOAP in ZF2.


Find SWF dimensions with PHP

Wow, so it’s been a long time since I posted here.  It’s quite alarming to think how much has happened since March 2008!  Hopefully I’ll start posting here more often again, more as a written record of things I’ve found useful that will benefit me.  With that in mind,  here’s something that came up today.  It’s a very simple thing, but I’m going to find it very useful in developing the banner section of Biff’s portfolio site.

It is possible to find the dimensions of a SWF using PHP’s  getimagesize() function.  Here’s an example: