Taking the Zend Framework for a Spin
Last night, I found myself with a bit of free time and mental energy for the first time in quite a few weeks. I headed over to my backlog of "interesting crap" for something I'd marked for later review and took notice of a real-world project using the Zend Framework.
A couple of months ago, I dipped my toe into the Zend Framework for some specific tasks, but hadn't really had time since to look at it in a more general way.
Given that the Zend Framework differs from many of the others out there in being more of a set of libraries that are designed to work together and less of the magic "do it for me" stuff that, while it feels good at first, always tends to make me uneasy.
The linked article about building fav.or.it with the framework does a good job of showing the breadth of components. I was mostly interested in some of the bits that I often put off too long in building applications: logging, exception handling and caching.
That's the stuff that lets you write your own code, your own way, but helps you do it correctly. I wrote a quick test app to try out those features: a basic podcatcher for podcasts.
I used the Zend HTTP Client (instead of CURL or wget) to fetch files, with proper exception handling and logging of the activity. I also used the RSS bits for obvious reasons and included the Cache to keep from hammering the remote sites' RSS every time the app loaded data.
Other than a few early glitches with include paths (why is it that pointers to libraries are a pain in the butt in every mainstream language?) it came together fairly easily.
Of the pieces I was trying out, the Cache is the one that I dug the most. I'm a HUGE proponent of caching stuff whenever you can. There's no reason that data that changes once every six months is fetched on each and every page request.
The Zend Cache module lets you not only cache normal "files", but, by including " 'automatic_serialization' => true" in your options for the cache, you can serialize pretty much any object/variable you want. You pretty much only need to provide a unique name for later retrieval and you have handy caching of whatever you need.
Since a lot of the stuff I write doesn't fit neatly into the CRUD (Create Read Update Delete) mold that many of the frameworks like Rails, CakePHP and company tend to impose, having a framework that's a little more laid back and free about how to do things is a handy thing to have in your toolbox.

