Wojciech Szela

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: ,

Thomas Weidner’s Blog: Boolean filtering

Thomas Widner contributed another one Zend Framework component. This time it’s a boolean filter.

…another one of my new components has been moved to core… Zend_Filter_Boolean. You say that you don’t need this filter? You can simply cast to boolean? Let me describe you why you are wrong.

With this very flexible one is able to automatically filter boolean input data, with casting or without. The filter is very flexible and powerful, providing support for cases like yes/no/don’t know and localized natural language input.

Thomas Weidner’s Blog: Currencies within the view

Thomas Weidner contributed to Zend Framework new currency view helper.

Today the last missing sheep of my new Zend_Currency implementation has been moved to core. It’s the view helper for currencies which was missing. Zend_View_Helper_Currency. Together with the new Zend_Currency implementation it simplifies rendering for all using currencies within their application.

Rob Allen’s Blog: Determining if a ZF view helper exists

In his recent post Rob Allen shares a tip about determining if a Zend Framework view helper exists.

If you need to know whether a view helper exists before you call it, one way is to write a simple view helper to tell you. You can then use it in a view scripts…

This tiny feature might be helpful for people developing plugable systems or in any other case where desired helper might not exist (eg. too old ZF version).

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