As we set out to build the next great social ecommerce platform we were struck with a rare and great opportunity to start with a clean slate. We were able to select each piece of our architecture without any predefined requirements. This let us review the state of the Frameworks in PHP and select the best one for our needs.
First we developed a set of requirements
Brace yourself, it’s a long list.
- DB Obj relationships ie: :has_many
- Good db migration mgmt
- Good master slave config for db
- Intelligent db trans support
- CRUD friendly
- Business logic kept in model not controller
- Controllers have ability to get heavy
- No heavy loading of controllers
- No race conditions for controllers (ie routing)
- Template engine
- Objects accessible in view
- Widget/component support in view layer
- Good header mgmt
- Good mgmt of js and css files
- All js and css be compressed
- Ability to define explict routes or priorities not based on file system
- Smart SEO urls by default
- XSS & CSRF Protection
- Good Form builders
- Form Validations
- No XML => YML or JSON
- enforcement of coding stds
- Convention and configuration
- Ability to design by contract
- Caching: Support for memcache and sessions
- Configs cached not parsed
- Cloud sensitive
- Good role base ACL support (no global, system base)
- Support for webservices
- Easily loadable support for external libs
- Profiler built in or easy to integrate (timers, number of queries, memory used, etc)
- Localization (currency, dates etc)
- CLI model access
- CLI for testing
- Unit testing
- Actions are unit testable
- Good file handling
- Good exception handling – ie log4j
- Support for multiple environments (dev, test, staging, prod)
Then we looked at any framework that someone on the team would be willing to evaluate. We ended up with 7 Frameworks to compare.
We only evaluated PHP specific frameworks as our team is primarily a PHP team and that is where our expertise is.
Notice that Zend Framework, Cake, Code Ignitor or X Framework aren’t on the list. There were a good 10 or so popular frameworks that enough of our developers had used before and knew they didn’t meet our requirements, so we decided not to spend time evaluating them further.
We performed this analysis May 2010. In the past 6 months both Symfony2 and Lithium which are under rapid development would score even better. It’s not my intention to keep this chart up to date as it’s a representation of historical analysis.
At the end of our week of analysis we had a good overview of each Framework though there wasn’t a clear winner. What was apparent was that a “check” wasn’t equal to another check and some frameworks excelled in certain areas where other’s simply did enough to check the box. This made our analysis quite a bit harder.
Additionally there were some other factors that weighted heavily into our decision. Strength of community, Quality of development and Momentum are the three factors that played the biggest role in our decision making, but are not represented in this feature set analysis.
Ultimately we narrowed it down to 3 frameworks. Lithium, Symfony2 and Zoop2. All 3 were PHP 5.2+ and Next Generation Frameworks. Given the substantial changes accompanying PHP 5.3, we determined that either we went with that now, or had a painful migration in our future. We decided to bite the bullet now which left us to choose between Lithium and Symfony2.
Lithium vs Symfony2
This wasn’t an easy decision. Both are excellent frameworks developed by really smart people. Nate Abele, who started the Lithium project and was the lead developer of CakePHP, is’s a personal friend and an NYC local. He was the person who turned me, and consequently OpenSky, on to MongoDB. Nate is doing innovative things with Lithium and has a true passion for what his work.
Symfony2 is developed by Sensio Labs located primarily in France, on the other side of the world. At the time there were only 3 stateside Symfony team members. Symfony2 uses a bit more conservative approach to framework development, basing it largely on learnings from symfony 1 and established practices and patterns largely from the Java world.
Ultimately we went with Symfony2. It wasn’t a cut and dry decision and in spite of all our diligence still ended up as a bit of a gut call. Symfony boasted a larger developer base and community. This was probably the factor that ultimately pushed us in Symfony2′s direction.
Fast forward 9 months. OpenSky has embraced Symfony2 with open arms. We have become the 2nd largest contributors to Symfony2 behind Sensio Labs. We employ Kris Wallsmith and Jon Wage, two core Symfony2 team members. We’ve developed one of the first production applications using Symfony2 and the first ecommerce platform on MongoDB.
by Steve Francia
11:00 am • 3 February 2011 • 7 notes | osky-tech-admin