I agree to the use of cookies in accordance with the Sourcefabric Privacy Policy.

Support our media development efforts

Who, what, when, where and why

Get the latest news about Sourcefabric software, solutions and ideas.

BACK TO BLOG OVERVIEW

Why Sourcefabric chose Zend as our PHP framework

Back in the Fall of 2010, we needed a new PHP framework for our applications. Neither of our applications - Newscoop or Airtime - had anything that could really be called a framework, though our code was generally separated into Models, Views, and Controllers (MVC).  But it wasn't pretty. We were in need of an established MVC framework to build on.

 

Development research.

The dev team set out to research a bunch of PHP frameworks: Yii, Nette, CakePHP, Kohana, Symfony, and Zend Framework.  Here's the quick-and-dirty analysis of them with respect to our needs at the time:

Yii - Version 1.1 looked good but the deal-breaker was that it was being completely rewritten for the next version, and had a very short support timeline for the older version (End of maintenance was marked as "Dec 31, 2012").  We didn't want to base our code on something that was going to be quickly obsolete.

Nette - Our developers seemed to like this one the most, but the deal-breaker was that all the documentation was in Czech.

CakePHP - This framework doesn't lend itself to incremental refactoring - it assumes that you have been using it from day one. It was also known as the slowest framework out there.

Kohana - Everyone was in general agreement that it is a good framework, but the documentation for version 3 was nearly non-existent when we reviewed it.

Symfony - Development of version 2 of the platform was under way when we evaluated it.  Version 2 is a complete rewrite, totally incompatible with the old one. Again, we didnt want to base our code on a framework that was going to be obsolete.  (Why keep the same name if it is a brand new framework?)

Zend Framework - This framework allows you to use only the pieces of it that you need, and allows you to move to it incrementally. Three full time developers work on this project, with their salaries paid by the Zend corporation. There are 155 committers to the project.  Many other companies have based their products on this such as Magento, Pimcore, and Piwik, some of which contribute back new components from other companies.  The next generation of Zend Framework, version 2, looks sane and will have an upgrade path for those using version 1.

The main deal-breakers for most of these projects were:

  • lack of long-term maintenance and/or transparency of the development process
  • a requirement to buy-in to the whole framework from the beginning
  • lack of documentation

 

Evaluating Zend Framework.

Zend Framework, while not perfect, seemed to be the best for our needs. It had a good architecture, long-term maintenance strategy, corporate funding, received large contributions from companies and individuals, had regular bugfix releases, and had established a "Community Review Team" to evaluate new code submissions from 3rd parties. In short: good code, good roadmap, good team, good governance, and good community.

We've now been using the Zend Framework on Airtime since the Fall of 2010 and on Newscoop since the Spring of 2011. Airtime has completely switched over to the framework and Newscoop is in the process of doing so (due to it's larger size). It has made our code a lot cleaner and easier to understand. Developers on both projects have been able to help each other since both apps are on the same framework.

 

Pros and cons.

It is a very flexible framework because it allows you to modify how it works in almost every way. For example, you can insert an operation at any point in the request cycle, such as prior to routing or before or after controller execution (we used that trick in Airtime to avoid sending duplicate messages to RabbitMQ). The Zend Framework has also allowed our UI designer to directly modify our HTML code instead of sending it back and forth from designer to developer.

The difficulty in Zend is usually finding out how to make it do what you want it to do - the learning curve is a bit steep. The documentation for Zend could be improved; while good basic documentation is available, it's more difficult to find real-world code examples. Zend_Form has been difficult to use and generally disliked by just about all developers here. Zend's debugging capabilities could be improved by getting a debug toolbar like Symfony or Kohana.

 

Conclusions.

Overall, using Zend has helped us to create clean, structured code and for most cases has lowered our implementation time for new features. The cases where it hasn't have been due to the learning curve of figuring out how to implement what we want within the framework. Even though there are some things that could be better, the net benefit has been positive for us.

The next major architectural change we are working on is getting our data storage layer in order. More on that later.


Sourcefabric develops open source software for independent media organisations, including the Knight-Batten award-winning Newscoop, a CMS for online publications, and Airtime, radio automation software.

BACK TO TOP