2010 January

Loïc Frering’s Blog: Integrating Symfony Dependency Injection Service Container with Zend Framework

In a new post to his blog, Loïc Frering is looking into integrating Symfony Dependency Injection Service with Zend Framework.

Dependency Injection is an Inversion of Control specific pattern highly used and encouraged throughout Zend Framework implementation. A Dependency Injection container manages your services life-cycle, it is in charge of their instantiation, configuration and injection as shared instances: no more need to use static methods, singletons or factories for your services!

Loïc is showing how to extend existing Zend Framework’s infrastructure to bootstrap Symfony’s Service Container, configure it and make services available through an action helper.

Thomas Weidner’s Blog: Translating validation messages

Thomas Weidner revealed another “new” feature for Zend Framework 1.10 (expected to be released tomorrow). The framework comes now with translated validation messages.

As you know the returned error messages can be changed. This is very important for sites which are not delivered in english. But they must translate all messages into their own language. This is a very tendious task.

Follow to his post and read how to use pre-translated validation messages directly on your website and how to add them to your translations repository.

Zend Framework Documentation Now Version Specific

Zend Framework’s documentation can be now browsed by ZF version. This recently added new feature should help a lot in learning the framework and developing applications, as not everyone can always upgrade to the newest version and the newest version does not have to be compatible with previous ones.

New documentation website includes documentation for Zend Framework 1.0 up to 1.10, in several different languages. Search feature has been also updated and search results can be now limited to certain version.

by Wojciech Szela on January 25, 2010 in News, No Comments »
tags:

Adam Jensen’s Blog: Cron tasks in Zend Framework apps

In his recent post Adam Jensen is presenting his approach to creating cron jobs in Zend Framework without having to load entire MVC infrastructure.

Now, any cron task we might envision will most likely need access to a fully-bootstrapped instance of the application; that way we’ll be able to use all of the framework’s usual development conveniences. However, loading the full MVC architecture is a bit of overkill, since we’re going to be performing the same basic sequence of tasks every time the script is hit (see Matthew Weier-O’Phinney’s recent discussion of service APIs for some other relevant concerns). So, we’re going to need a new application bootstrap and entry point, one that eschews the MVC routing and dispatch process in favor of something simpler. Essentially, all we’ll need is to be able to run an arbitrary collection of cron “task plugins,” the list of which can be configured in plain text via any of the various Zend_Config formats (e.g., the default application.ini file).

Adam’s solution is a “framework” or “environment” for developing and running cron jobs. He created cron service to handle execution of tasks, a cron job interface and a plugin infrastructure and shows us how to use it to write simple cron task.

by Wojciech Szela on January 25, 2010 in News, No Comments »
tags: ,

Matthew Turland’s Blog: Getting Started with Zend_Test

On his blog Matthew Turland is sharing his first time experience working with Zend_Test.

I worked on a project recently where we used Zend Framework. As part of that project, I was tasked with writing unit tests. So, I went to the “tests” directory generated for me by the zf CLI utility to get started. What I found there was three files. […] They were all completely empty, which didn’t really provide much in the way of guidance on how to get started. The Zend_Test documentation is good, but was a bit lacking in that area as well; it really only covers how Zend_Test extends the capabilities of PHPUnit.

Mathew walks you through entire process of preparing simple testing environment for Zend_Test, from explaining auto-generated “tests” folder content, through configuration and bootstrapping, to writing and running controller test, including database support and fixtures.

by Wojciech Szela on January 18, 2010 in News, No Comments »
tags: ,