Archive for June, 2008

26th Jun 2008

BugMiner

So as well as being the God of unit testing in PHP it seems that Sebastian Bergmann ahas created a new project called BugMiner. It looks to be a very cool tool that will use your version control repository to ascertain metrics about risk and complexity. I’ve not had a chance to play with it yet but I’m always impresses with Sebastian so I have high hopes.

Posted in PHP, Testing | No Comments »

26th Jun 2008

Overloading Internal PHP Classes With Namespaces

Over on Greg Beaver’s Blog he talks about a patch he very quickly got into the PHP 5.3 and HEAD repository that will allow you to import a class into the global name space and override the internal PHP classes if the name matches. This means you could fix a bug in one of the PHP classes if you needed to or even use it for unit testing. I wounder if you could over load PDO?

Posted in PHP, Testing | No Comments »

26th Jun 2008

PHPUnit MySql 4 Support and iniSet

So I’ve been getting very heavily into QA here in my new job at Beatport. As a result I’ve been doing alot of work with PHPUnit and I came across two problems one same and one large. The first was that the very useful iniSet function that will let you change an PHP setting like error_reporting and then restore it for you after the test has run. The problem I has was it required the value to be a string, which while not a show stopper was a pain. So I was very excited in a very nerdy way when my suggestion was implemented in the code and made it into a release.

The next problem was a biggie as far as I can tell the DBUnit port into PHPUnit know as the Database extension doesn’t support MySql 4. I outlined the problem in a ticket and also posted a patch that will get everything working for MySql 4 and 5.

Mike Lively the creator and maintainer of the DBUnit port it yet to take any visible action as of yet. And as I used to work with Mike I may have to drop him a line to get his opinion.

I’d love to hear from anyone else who is also having this problem with MySql 4.

Posted in Uncategorized | No Comments »

25th Jun 2008

Getting Excited About SplFastArray

After reading about the new SplFastArry on Colder’s blog I started to get really excited about the possibilities and this could really give a boost in a lot of places. The thing to keep in mind is that SplFastArray will only increase performance when you add, remove, and generally access elements and you’ll see a decrease in performance when you are iterating or counting.

Posted in PHP | No Comments »

25th Jun 2008

Is PHP a Framework?

I was reading a post by Akash Mehta, on the fact the he feels that PHP is a half framework in its self. I think that’s a really interesting idea and it makes a lot of sense to me. I’m still a big believe in using frameworks on top of PHP but only because I believe it lets you focus on the real work of creating application and not because they are better then rolling your own framework.

Posted in Uncategorized | No Comments »

25th Jun 2008

Cutting Use of Zend_Log in Half - The Easy Way

After reading Tony Bibbs post on how he cut his usage of Zend_Log in half by taking

$logger = Zend_Registry::get('logger');
$logger->log($errorMessage,1);

And creating

MyLog::log('Kernel starting up');

While the benefits of abstracting the Zend code away from your code to allow you to switch to another logger at some other time are all well and good. If you just want to reduce your line count, surely simply doing the following would do the same.

Zend_Registry::get('logger')->log($errorMessage,1);

Posted in PHP | No Comments »