Sunday, 26 August 2007

Setting up Zend Framework applications with Phing

After spending too much time on directory and view script shifting to align an 'older' Zend Framework application to the very useful ViewRenderer Action Helper of the follow-up releases I crafted a single Phing buildfile to stick to the recommended conventions and to have a nearly 'one-button' setup solution for any upcoming projects.

There are already some solutions available ranging from prepacked application skeletons to programmatically creators. Of course this is a rude violation of the DRY principle, but you are welcome to read about the basic features the Phing based solution has to offer for now.

Requirements


Features

  • Building a default or modular application directory structure

  • Generating Controller, Model and View skeletons

  • Php linting/validation of generated skeletons

  • Customizable Controller, Model and bootstrap templates

  • Retrieval of a specific Zend Framework version via svn or get

  • Bootstrap file generation

  • Modular targets to generate and add Models and Controllers skeletons belated


Open/possible improvements

  • Couple Model generation with basic database table creating and seeding

  • Zend_Db, Zend_Registry and Zend_Log setup

  • Alignment to Zend_Application proposal, when it's moved into core


After having all requirements aboard it only comes down to the following two steps:

  1. Run the buildfile in the targeted directory

  2. Set the document root to the applications html directory e.g. by using Apaches VirtualHost capabilities

Although it's tested and I put some thoughts in it, any feedback about detected flaws and additional improvements are highly appreciated.

3 comments:

Travis Swicegood said...

Very nice. A good use of existing tools to get the job done and one of those "why didn't I think of that?" kind of things :-)

Andries Seutens said...

Hi,

Thanks for the credits!

Mario Garcia said...

Great job!!!!