Vous êtes sur la page 1sur 5

PHP Framework Comparison

June 2011

By Emiel Masyn
ema@emakina.com emiel187@gmail.com

General
There are a lot of PHP Frameworks, but as I started from the top 3 I worked my way down and stopped where no framework could add any value. For me it was clear that the current leaders are Zend Framework, CakePHP, Symfony, CodeIgniter and Yii. Before I get into details I would like to say that the consensus among many is that each framework has its one use and purpose. As I dont have time nor experience with any of them Ive tried to base this article on reviews from people who are not only experienced themselves but who also had comments from other programmers. In comparison to other developers I have no predilection for one or another. As I could let you figure things out yourself on the comparison matrix Ill try to point things out that arent very clear or could use some extra info. Aside from the technical capabilities, who mostly dont need any further explanation, there are some subjects that can have influence on the efficiency of programmers.

Scalability
Not all frameworks are equally scalable, that means some are not meant to make complex systems, unlike others who are only made for medium to large projects. Scalability has little to do with growth, but more with control over you application. It is also mostly up to programmers, but some of these frameworks support scaling better than others. 1. Zend Framework and Symfony have both a lot of features supporting large systems. Zend has a lot of components, where you have control over each component. Symfony has a solid architecture as well and has been used for websites like Yahoo Answers and Delicious. It is aimed at development for robust applications in an enterprise environment. They are both very flexible and highly configurable. 2. You should only use what you need, so for rather small websites CodeIgniter or CakePHP is maybe a better option. Although CakePHP has been used for several larger websites it depends on a lot of conventions, leaving the control with the framework and not with the programmer. These frameworks tend to be less scalable, but make it easier for developers. 3. Yii is somewhere in the middle and can be scalable to larger (or smaller systems) without any performance drop.

Learning curve and Community support


1. CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code. Handing over a little more responsibilities to the framework, developers can make use of the automation. All unspecified attributes or settings are filled in by default. This can be a poisoned gift as developers dont need to know everything to get things working, it also means that if some trouble occurs it can be implied by not specifying.

2. Zend Framework is very extensive, the learning curve can be steep but once known a very powerful tool. There are also some training possibilities organized from Zend with an exam (Zend Certified Engineer) and there is a huge community using it and supporting other developers along the way. 3. CodeIgniter is easy-to-use and very lightweight. It wont do anything what you dont ask and focusses on configuration over convention. You dont have to get every module/semantic to use it and develop fast. CodeIgniter is gaining more documentation online as it was poor some years ago. Now it is made very clear and a lot of users have put tutorials and wikis together. It is more of a starters framework for programmers unfamiliar with the MVC pattern. 4. Yii has excellent documentation and a very active forum community. It has a medium learning curve and is not hard to learn for moderate to good experienced PHP developers. 5. Symfony is well documented, but like Zend the start can be a little rough. There are a lot of good online tutorials to help you take off in the right direction, bot official and from other developers.

Configuration
Before you can start working on any project, things need to be configured. As opposed to starting fast, you could prefer starting good (and maybe a little slower). Because most configurations are copy pasted from 2 or 3 basic projects with some small adaptions, dont worry too much about the configuration. There are some differences Id like to point out though: 1. Zend has quite some configuration options: PHP Arrays, XML, Yaml, Json or ini files. It may give some more freedom to the programmer using different kinds of configurations. Zend made it also possible to have different levels of configurations and even merge some into one configuration. 2. Symfony only supports Yaml. As Im not acquainted to this method I would leave it in the middle if this method beats the other configuration modes or not. 3. CodeIgniter, CakePHP and Yii use php arrays for configuration and are fairly easy to set up. You put values in an array, pass them through as an argument and load the view. Database settings are kept in an array in a config file.

Performance
CodeIgniter and Yii are by far the most performing frameworks. Symfony, CakePHP and Zend are rather slow without configuration. But there are various settings you can enable/disable to speed things up. From turning off debug mode to using caching in several ways you can enhance your framework performance. CodeIgniter is for instance very lightweight, it will have less performance configuration. It also gives the programmer less freedom. Zend on the other hand gives a lot of freedom, but will require some configuration to speed things up. Its a tradeoff you have to make. The slower the framework the more caching possibilities there are.

Unique characteristics Zend Framework is Complete


Zend Framework offers a full and complete set of building materials to build your online empire. You can have different modules interacting on different layers, specifying the system to your needs. 80% of the code will be written and a 20% of the functionality youll have to add yourself, afterwards you have to glue all pieces together.

Symfony is Enterprise minded


Symfony makes agile programming principles possible (such as DRY, KISS or the XP philosophy) and focus on applicative logic without losing time to configuration and settings. It focusses on the larger enterprise systems. Symfony has the ability to auto generate an admin section is your database is well-designed, leaving you with some kind of CMS. You can import Zend Framework classes into Symfony (not the other way around), thats maybe one of the better ways to reuse code and libraries. If you cant beat them, join them.

CakePHP has Automation


Use the conventions, get code for free. As CakePHP prefers convention over configuration it has been able to provide some default functionalities. You can use scaffolding and the bake functionality to generate basic code. Just tweak the code afterwards to your needs, no need to implement the no brainers.

CodeIgniter for Fast developing


Designed to enable, not overwhelm, Code Igniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications.

Yii is Performing
Yii is a high-performance framework. As you can see it doesnt differ a lot without APC from other frameworks, but once configured right it can increase your website performance exponentially. Yii is using the lazy loading technique extensively too acquire this performance.

Conclusion
As I remain with the fact that every framework will serve its own use and purpose, there are 3 classes in which I like to divide these frameworks. Lightweight CodeIgniter CakePHP Overall performer Yii Complex systems Zend Framework Symfony

The lightweight frameworks are good for small, less scalable and simple websites. They still offer a lot of possibilities, but it might turn out youll have to implement things yourself if you want to extend it later on. The overall performer and also most popular on some websites is Yii, its known for a performing and easy-to-use platform for small and large systems. One of the newer frameworks gaining a lot of popularity. Little to no PHP4 ballast, but still has some features to develop. Zend Framework and Symfony are maybe the hardest to learn, but you gain a lot of your time back if you can turn that knowledge into well-defined complex systems. These two shouldnt be used for small websites, although its possible. A very interesting feature is that you can import ZF classes into Symfony, to use some functionality of the extensive amount of libraries that Zend Framework provides. Zend is the C++ of the PHP Frameworks, its very flexible, very powerful and you can configure everything the way you want in a very complex/layered way. But dont use it if you dont need it. As for all choices: choose wisely.

Vous aimerez peut-être aussi