25 Oct 2009, 6:13 p.m.

How Do You Zend_View? I'll Show You Mine...

An interesting design decision made by the Zend Framework team was, well, not to make too many decisions about how the View portion of a Zend Framework MVC application should be implemented. You can use plain PHP to generate markup, use a templating library such as Smarty or Savant, or go your own way entirely. At work we've used both Wall4PHP, and subsequently a custom component-based solution, for example.

The flexibility is great then, but with freedom comes responsibility. Perhaps coincidentally, view scripts tend to be the part of a ZF app that attract the most cruft, the most untestable code, and the most mingling of concerns (though controllers certainly give them a run for their money).

Since someone recently asked, I'll show how I've implemented views on pointbeing.net. I don't claim that the approach is awesome, or even suitable for every case, but it seems to work for me. In return I'd very much like to hear or see how others implement their Zend_Views.

Posted by Simon Read more »
14 Oct 2009, 10:23 a.m.

Manual Comment Spam

Some time last year I installed a CAPTCHA tool on this site, in an attempt to mitigate the deluge of spam comments that I was receiving.

It has actually been very successful: despite some fairly concerted attempts, since that date, I don't think any automated spam has got through.

What I am seeing, however, is a steady increase in the amount of manual spam. By this I mean actual human people coming to the site and entering inane comments promoting various seedy businesses. I guess hiring kids or the unemployed to do this is no more expensive than hiring people to hand out flyers in the street - and you see plenty of that.

So I'd be interested to hear if other bloggers are seeing this, and how they tend to deal with it.

In the meantime, if you are among this type of spammer, I'll politely ask you to move along elsewhere: I'll only delete your comment and block your IP, and it'll become quite tiresome for all of us. william@geeksltd.co.uk, that includes you, though I suspect that's a made up address.

Normal service will now be resumed, and I promise that my next post will contain some real content!
Posted by Simon Read more »
10 Sep 2009, 11:07 p.m.

Git for Subversion Users

As readers may have gathered from previous blog posts, I'm something of a fan of version control and of Subversion in particular.

In recent months it has become increasingly difficult to miss the buzz surrounding Git, a version control system originally developed by Linus Torvalds to aid development work on the Linux kernel. Git is gaining a lot of ground, with a number of major projects (for example Perl, Samba and Wine) having been migrated to it.

So here's a bit of an introduction to Git from a Subversion (and CVS) user's point of view. The post won't be particularly detailed or comprehensive, as there is plenty of documentation on the web, but should hopefully provide some insight into what looks to be a very promising tool which takes an interesting approach to version control.

Posted by Simon Read more »
27 Aug 2009, 12:44 p.m.

Check Out Ciaran's Doctrine Article in php|architect

The cover of php|architect's August 09 issue

I'm pleased to note that the August 2009 issue of php|architect is out today, not least because it includes a cracking article on Doctrine by my good friend Ciaran. I was lucky enough to sneak an early peek, and despite my innate distrust of anything new-fangled and shiny, to Ciaran's credit, even I had to admit that Doctrine does look quite useful actually. I'm looking forward to Ciaran's next article!

The issue looks to be a good one all round, with articles on regular expressions and non-relational databases along with the usual news, comment and photos of ElePHPants, so do check it out.

Oh, and look out for something from me in either the September or October issue!

Posted by Simon Read more »
20 Aug 2009, 10:31 p.m.

Lightweight Continuous Integration for PHP

This post describes a simple, lightweight strategy for implementing Continuous Integration on PHP-based software projects. This approach happens to use Subversion for version control, PHPUnit for unit testing, and Phing to automate the processes involved, but hopefully the principles are generally applicable.

The post won't strive to be exhaustive or encyclopaedic, rather it will present a simple proof-of-concept and a brief overview of the tools that are available to PHP developers. But first some background...

Posted by Simon Read more »
15 Jul 2009, 6:39 p.m.

Busting Some Myths Concerning robots.txt

After all these years, there still seems to be quite a lot of confusion and misinformation floating around about "robots.txt" files, how they work, and what they do, so I'd like to go some way towards clearing up that confusion here.

Posted by Simon Read more »
13 Jul 2009, 5:40 p.m.

Zend_Session Overrides php.ini Settings

This post concerns some curious behaviour in Zend_Session. We spent about a day of developer time tracking this down, and I'm still a bit puzzled about it. It doesn't appear anywhere obvious in the documentation, and I haven't found a great deal on the web about it, so maybe this will save somebody some time, if nothing else.

Posted by Simon Read more »
27 Jun 2009, 3:46 p.m.

Bonus Schemes Should Be Handled with Care

I was recently chatting with a colleague about bonus schemes, and it occurred to me that every single company I've worked for (that's four, if we're counting) has implemented at least one such scheme, and the outcome is always the same: pissed-off employees.

There seems to be a kind of unquestioned assumption that employees want bonus schemes, and that employers are being good employers by introducing them. Such schemes are, without exception, described as being a "benefit". After all, who doesn't enjoy receiving a bonus with their pay cheque? What could possibly go wrong?

I'd like to argue that bonus schemes can go wrong. In fact, they are harmful more often than not, and should be handled with care.

Posted by Simon Read more »
26 Jun 2009, 8:20 p.m.

Command-Line Subversion Tutorial, Part 3: Subversion Properties

In Part 1 of this series we looked at the basics of command-line Subversion, and Part 2 covered importing, branching and merging. In this third part I'd like to introduce a useful and very powerful Subversion feature, which isn't always terribly well understood by developers: that of Subversion Properties.

Posted by Simon Read more »
9 Jun 2009, 6:26 p.m.

Some Thoughts on Solving Advanced Cryptic Crosswords

I've recently been enjoying - if that's the right word - advanced cryptic crosswords. These are those extra challenging puzzles that crop up in the weekend supplements of the broadsheet newspapers here in the UK.

Advanced cryptics aren't quite like normal crosswords. They tend to be set out on a "barred" grid, as opposed to the more familiar "black and white" version, they typically employ obscure or obsolete vocabulary, and they often feature "special instructions" in the preamble of the puzzle. For example, the solver may be expected insert or remove letters before writing in the grid entry, or resolve clashes between "across" and "down" answers. It can be a bit like solving a puzzle layered on top of a puzzle on top of a puzzle.

Examples of the genre include Inquisitor and Beelzebub in the Independent, Mephisto and The Listener in the Times, Enigmatic Variations in the Sunday Telegraph and, perhaps the father of them all, Azed in the Observer.

I'm not even close to being an expert on these, but I've picked up a few...er...clues over recent months, and I thought it couldn't hurt to share what I've found out so far, and perhaps see if readers have any further advice. So here are my thoughts on solving advanced cryptics.

Posted by Simon Read more »