PHP Frameworks – A Review

I've gone over what frameworks are, what I look for in a framework, and the relative performance of the various PHP frameworks available. With this article I'd like to review each of the most popular PHP frameworks, and the current state of PHP Frameworks. Let's get started.

In selecting these frameworks, I have eliminated commercial frameworks, specialized frameworks, component frameworks, frameworks with CMS, and frameworks that are no longer in development. You want a supported framework with developers working on improving the framework.

This drops the list from over 70 to 10 frameworks consisting of, needless to say, currently the most popular frameworks: Akelos, CakePHP, Codeigniter, DooPHP, Fuse, Kohana, Qcodo, Solar, Symfony, Yii, and Zend. If I missed a couple, we'll get them next time. I'm going to go over these one at a time and just give you my impressions.

Akelos was made to mimic Ruby on Rails in PHP with an MVC architechture. It offers code generation, scaffolding, and i18n internationalization. It has good documentation offering tutorials, videos, a manual and a wiki. I'd rate their doc a 4.0 on a scale of 1 to 5 with 5 being best. It has a fairly active forum. Akelos uses Active Records, like Rails, for database hookup. It runs both PHP4 and 5, and therefore is not truly object oriented. My initial impression of Akelos is it is farily bloated, and almost too aligned with its Rails clone image.

CakePHP has an excellent and passionate user community. Documentation is just OK, I rated it a 2.0. There are currently four books published on CakePHP. However, I did not see any tutorials, or videos on their site. They have an API, but send readers to buy the books to learn Cake. Cake is very restrictive in the way things are connected in your application. Although people rave about this frameworks automatic connections, because of their strict naming conventions, if I was just starting out, I would pass, the learning curve seems steep compared to other frameworks, and the performance is not there.

Codeigniter has excellent documentation, they have video tutorials, tutorials, a user's manual, a wiki, and an active forum. There are four books published on Codeigniter. I rate their documentation at 4.5. Codeigniter is one of the quickest frameworks. However, it is still PHP4 based. They have said they are working on Codeigniter 2.0 based on PHP5, but it will not be fully PHP5 until version 2.1. Codeigniter is made by Ellis Labs who have treated it as a hobby, and notoriously have taken a very long time between releases, which is one of the reasons Kohana spun off a fork. Don't expect 2.0 to be soon, but their working on it.

DooPHP claims it is the "fastest PHP framework," and if their benchmarks are to be believed, it truly can haul butt. It supports PHP5 only, an ORM,  i18n international, templates, and URI routing. However, it achieves this speed by being light in its functionality and implementation, and at present there is no consideration of overall security. Their documentation and web site are excellent, and well written. I rate the docs a 4.00. Although they do not have videos, or a wiki, they have an excellent online manual, a class API, and tutorials to get you started. They have an active forum. My impression is they are still a little early in their development.

Fuse barely made this list. There were no benchmarks. However it is PHP5 based with an ORM and URI routing. They have a video, a wiki, and a class API with good install documentation. However, their documentation is sparse, and I rate it only a 1.5. There last forum update was two weeks ago. This framework feels like it is subsidiing with its last release in June of 2009.

Kohana is always changing and there lies its problems. When it forked from Codeigniter it quickly became popular as the PHP5 object oriented Codeigniter, and it is almost as fast as Codeigniter. It had good documentation for Kohana 2.4, however they just released 3.0 where they introduced a completely new architecture. They did this to become the only PHP framework supporting the HMVC architecture, read this as multiple MVC's on multiple servers all connected. I think they made this change knowing Codeigniter is working on their PHP5 version, and they wanted to separate themselves. However, at this writing, their documentation is awful for 3.0, which is what they recommend you use for a new project. I rate it a 1.0. There are no tutorials, no videos, and no books, just a sparse wiki and API. The forum is not really there yet. At this writing their lack of 3.0 documentation and support is enough to choose another framework, or use Kohana 2.4. Again, they just released 3.0. I do expect the documentation to get better, as they do have an active community, that will gradually build their new documentation, and when they do, Kohana's HMVC will again, emerge as a premier framework for large projects. Kohana gives me the impression that it is made for those that know PHP5 cold, and know what they are doing, not for the beginner.

Qcodo is similar to Akelos in that it models itself on Rails. It is PHP5 based, offers scaffolding, code generation, something called Qforms,  i18n, and database profiling. They advertise a rapid application development platform that rolls out in minutes instead of hours. However, I found no benchmarks on Qcodo, and I suspect some bloat here due to the code generation. I put them in the same category and performance as Akelos, with Akelos in the lead, because of their documentation, although they are newer and are PHP5 only. Qcodo's documentation is lacking, there are no videos, no wiki, no tutorials, not a good install doc, but they do have some online docs, and a Class API. I rate their doc at 1.5. They do have an active forum.

Solar almost did not make this list, but I found some benchmarks so I included them. They are PHP5 and MVC, with a good form modeler, but no ORM. Their documentation is OK. They do not have video tutorials, but they do have tutorials, and very good online documentation integrated with the API. I rate their doc a 2.5, but sadly I could not find a forum.

Symfony 1.4.2 was in the CakePHP performance category, a dog. Their new release 2.0 is three times quicker, and now respectable. However, their new release is not out for another month or so. You can get the preview release now, which is how benchmarks on the 2.0 framework started showing up. Symfony has a wide following at the corporate level. It has a reputation as being difficult to learn as evidence by their seven published books. It's documentation falls into the same category as Kohana, slim on the new release and better on the old release. The old version has video tutorials, tutorials, documentation, no wiki, and their install doc is so-so. I rate their old documentation a 2.5 and their new version a 0.5. They have an active forum.

Yii started out as a competitor to Kohana. It is PHP 5 only, they use an Active Records, i18n, and themes. They initially generate the site from the command line.  Yii uses MVC with a front-end controller that distributes to the other controllers in your application.  Yii is reusable and extensible. It's fast and just as quick as Kohana and Codeigniter. For awhile, Kohana had its way, but gradually over time Yii has been coming on strong, due to greatly improving documentation. Now with the release of Kohana 3.0, I'd have to give the nod to Yii. Yii's current documentation is excellent, they have good install docs, tutorials, a Class API, and good online docs. They do not have video tutorials, or a wiki, but I still rate their documentation at 4.5. They have an active forum and a growing user base.

Zend is a rich library, since the Zend framework is supported by Zend the makers of PHP, it is up to date and full of functionality. However, it is bloated, almost reminds me of the PEAR library, instead of a framework, and their performance shows it. Unfortunately Zend uses the framework as a "come on" for you to buy their other products. The documentation for the framework is buried around their commercial products on their web site, and hard to find. When you get to it, it is thorough with a Class API, however there are no tutorials. Zend has the reputation as being difficult to learn, and hard to use. There are currently 6 published books about it. I rate their documentation at a 3.0. Zend integrates their framework into their commercial tools, and tries to lock you into using the framework, because of that integration. They have an active forum.

That's it for now, I will sum this all up in a summary and conclusion in my next article.

Comments

PHP Frameworks – A Review — 3 Comments

  1. I have to agree with the poster above. I have been using ZF since November 2007 and have never experienced any of the issues you pointed out.

    1. I don’t use Zend Studio. I use either Eclipse PDT, VIM or Coda depending on which computer I am programming on.
    2. I have never had an issue finding documentation on ZF. I can even find archived documentation from older versions of ZF right on the main documentation website (http://framework.zend.com/).
    3. I have never experienced performance issues due to the overabundance of features. In fact, I have run many performance tests with and without ZF and have been very impressed with the efficiency of the code.
    4. As far as tutorials go, there are so many code snippets in their documentation that you can copy and paste into your code base to at least have a beginning block of code, that works, to begin customizing to your site’s needs.

    The thing I like most about ZF is that I can use some of it’s features without needing to load the entire framework. An example would be a recent side job I did for a website owner who needed a good cache system built to speed up his site’s search abilities. I was able to manage this by copying over the base classes needed for Zend_Cache and then extending the frontend and backend classes for customization. The entire job from start to finish took me about 2 hours where it would have taken me substantially longer had I been forced to create a cache system by hand.

    I can understand that reviewing so many frameworks is a daunting task. I had to test out and review cakePHP and Symphony before I was allowed to recommend ZF as a viable framework solution at my current employer, and just reviewing 2 frameworks was a pain. That said, if you are going to undertake the task you have to be able to provide valid, honest feedback. I was really impressed with all of your feedback until I got to the part about ZF, and then it made me rethink everything you had written. It’s really a shame.

  2. Caveat: I’m project lead for Zend Framework.

    Your assumptions and conclusions about ZF are, well, surprising. The documentation for ZF is not buried on the commercial site at all — it’s clearly in the ZF site (http://framework.zend.com/manual/en/). We have a “Learning Zend Framework” section that has around a dozen tutorials currently, and users and contributors have a ton of material available that’s only a search away (hint: a good one is http://zendcasts.com/ — screencasts by a ZF user covering a ton of ZF topics).

    While ZF is integrated into other Zend tools such as Studio and Server, ZF is in no way dependent on them. Don’t believe me? I myself don’t use Studio when coding ZF — I use Vim. And I have a number of hand-compiled PHP binaries that I use to test ZF (I also use Server, but it’s only one binary of many I test against). Yes, Zend’s strategy is to use ZF as the “mouth” of the “funnel” to draw in new customers, but there is absolutely no lock-in — you can use ZF with or without other Zend products.

    Finally, regarding your assertion that ZF is “bloated”: you criticize other frameworks for not having enough features, yet as soon as you find one that has a ton of features, it becomes “bloated”. I find this fairly ironic — which do you want? ZF is use-at-will, so while there may be many features you never use, your only resource concerns (memory, etc.) will be around the components you _do_ use. If you don’t want to use the MVC layer for performance reasons, you can easily use ZF components in any of the other frameworks to provide additional functionality (this is actually quite common from those using Symfony, Solar, and CodeIgniter), filling in their gaps.

    • In response to the two comments above

      I have to agree with you that reviewing frameworks was a daunting task, a responsible one, and it was time consuming. If there is one thing I do regret from my review above, and that both weierophinney and Cody_C have so ably pointed out is my use of the word “bloated.”

      The word has such a negative connotation, and is highly subjective in its meaning. Whether it was because time constraints, or sheer laziness on my part in not being more clearer in my reviews, I regret the use of the word. I used the word three times in the review about three different frameworks, and unfortunately, in each case the word should not have been used the way it was.

      My assumption was if the framework was relatively slow in performance, it was bloated. Your assumption was that if the framework was rich in features, it was bloated. Thus, the highly negative and subjective meaning of the word. In hind site, I think there is a lot of errors in both assumptions.

      I called Akelos fairly bloated. Let me rephrase this to be mediocre performance based on one benchmark.

      I said that I suspected some bloat in Qcodo due to code generation. My assumption was that given their emphasis on rapid application development and code generation that there was probably some dead code that may or may not reside in the finished application. Unfortunately, Qcodo had no benchmark results yet, and I did qualify this in my conclusion saying in the case of Akelos and Qcodo, it was probably a tad unfair, since there were not enough benchmark results.

      Finally, I referred to it in the Zend framework, and I said it in a way to imply the meaning my two able commenters have pointed out, that rich features meant bloat, which is not necessarily so. However, having said that, I did want to convey that the Zend framework benchmarks were lacking in performance. Something that my two able Zend supporters have choosen to ignore.

      My comments on the Zend documentation was based on the difficulty I had finding your documentation from the main Zend corp web site. As it was, I gave you a 3.0 in documentation, which to me is fairly respectable compared to some of the other frameworks . Having reviewed the links from weierophinney in his comments, I would say the Zend framework documentation is excellent and should be up in the 4.0 range.

      I do not represent, nor do I have the time to actually create example code for each one of these frameworks, so my review, therefore, was not an in depth review, nor was it postured as such. My reviews were limited to feature set, overall architecture, documentation, and support. What I would call a preliminary review, that we all do, right before we start really digging into the code, please take these reviews in that light. Thank you for your comments.