Tutorials

An Example Zend Framework Blog Application – Part 1: Introductory Planning

Sep 25, 2008 insic 3 Comments

This is it. The Part 1 of Astrum Furtura ZFBlog Tutorial series. I did not change anything or add something of the tutorial. I just posting it here for the help of those who need it. All contents originally written by Padraic Brady of Astrum Futura.

An Example Zend Framework Blog Application – Part 1: Introductory Planning

The writing habit has kicked in after a few forum posts and lengthy emails. This inevitable result means I need something long and preferably technical to write about for a while. Since I’ve just come from the Devnetwork Forums where I was reading a query as to whether any standalone applications using the Zend Framework are available in open source (not many apparently), it was as good an excuse as any.

So here is Part 1 of another lengthy PHP tutorial series on writing a blog application using the Zend Framework. To make things interesting, this will not be an articifial example – when development has ceased, I will deploy and put into production my marvelous new blog, and then proceed to modify it to the point of death, bending it to my will. Muahahahaha.

Be afraid. Be very [deleted cliche].

Starting any new application is like walking into a shop and being dazzled by the displays. You want everything but finally realise you only have so much resources to spend. So you isolate the specifics you must have, and focus on those. That’s why I bought a Classic iPod, and not the much flashier iTouch (crap all storage anyway).

If we drill down the typical blog application we get a very short list of must-haves.

1. Authentication for Authors
2. Authorisation to create/edit/delete/read entries
3. Methods for adding new entries, and modifying them
4. Publishing entries as RSS and Atom
5. Permalinks unique for each entry (SEO friendly of course)
6. Commenting system
7. Spam detection for new comments
8. Perhaps, trackback detection

These 8 points will form the basis for Maugrim’s Marvellous Blog 1.0. Serendipity and WordPress watch your backs!

But seriously, we will not be challenging S9Y or WP. The application will not have a user friendly installer. You better pray you remember (or I tell you) how virtual hosts work for Apache 2.2. Please ensure you at least have PHP 5.2 installed! And no, there will be no plugin system (well, maybe a simple View Helper driven one integrated into our overall Application Layout). We’ll dispense with heavy acceptance testing, and rely only on some light unit testing with PHPUnit where we decide to write some custom classes (if any).

To every extent possible, we’ll rely solely on Zend Framework components (possibly a few in-proposal components as needed).

To make my life easier, here are the tools/libraries you can expect to see mentioned. The list is not exhaustive, but pretty much lays out what I consider standard libraries besides the Zend Framework itself. These extend to areas the ZF simply does not cover. It’s pretty short actually…

1. Zend Framework 1.5

2. PHPUnit

3. HTMLPurifier

4. Blueprint CSS Framework

5. jQuery

If you intend following this series and adding to my Google Pagerank, which always is appreciated for the day I launch a massive campaign of Google Text ads here, I will setup a public subversion repository containing the live code, i.e. the stuff I will edit week on week.

Finally, I am not responsible if the final application resulting from this tutorial crashes servers and results in the meltdown of the Internet. Such events are obviously Acts Of God, and I am a mere mortal who cannot be held liable.

Objective of the “An Example Zend Framework Blog Application” series:

Like I said earlier, I have fallen out of love with Serendipity. After a few years worth of upgrading, many of my posts have lost cohesion riddled with minor formatting errors from various Geshi, rich text editor and plugin filter order changes. I’ve also decided the main problem with an out of the box solution is that you need to learn a whole new API and development approach before you can tinker with the source code. Did I mention I am completely willing to pay money not to edit procedural code? ;-)

The series will culminate with a complete blogging solution for my personal needs. I’ll cook it, bake it, beat it into submission, and then deploy it to replace this existing Serendipity installation. Along the way I’ll revisit numerous Zend Framework components, and probably praise or dissect them for problems or shortcomings. Along with my own mistakes, no doubt! :-)

Reading the series in order, should hopefully piece together a reasonable approach to getting a Zend Framework based application off the ground. I will keep the more Agile/XP mentions to a minimum (not the focus of this series) but they will be in the background if anyone has questions.

Next up: A quick introduction to the Zend Framework of only fifteen pages of text. Installing the Framework. Setting up the simplest possible Zend Framework application whose sole utility is to say Hello.

About the author: insic

Subscribe in my RSS Feed for more updates on Web Design and Development related articles. Follow me on twitter or drop a message to my inbox.

  • Pingback: PHP Coding School » Blog Archive » php tutorial [2008-09-25 16:26:33]

  • Thomas

    Very much appreciated! I hope your host is more forgiving than his. When will you get around to add the rest? (and how many are there actually)

  • http://blog.insicdesigns.com insic2.0

    I am currently working on the rest of the tutorial. About the host i don’t think so, or maybe Padraic has his reason why he offline his blog.
    Before the blog astrumfutura.com lost, ZfBlog tutorial stops in part 10.