Thursday, May 29, 2014

The Hunt for a New PHP Framework

As we start to spin up new projects and products at Curve, we are always keeping an eye on our frameworks to make sure they are the right tool for the job. We recently decided to take another look at what's out there so we picked a few of the top PHP frameworks and attempted use them to write a simple web application.

We tried to break our time up in evenly-divisible chunks during the exercise which meant we had to drop some frameworks due to the time required to fix the problems we were running into. The resulting applications were run using Apache with PHP 5.5.12.

Laravel


Pros

  • Super easy to get going. Very straightforward and easy to understand. Feels very natural coming from a rails-style framework.
  • Active, strong community
  • Migrations are handled the way we want them to be.
  • Has built-in abstractions over queuing services like SQS and IronMQ.
  • Extensive documentation
  • Supports Composer
  • Would be able to split out the Eloquent ORM and use a data mapper (e.g. Doctrine) instead (e.g. Laravel-Doctrine or the Doctrine Bundle)

Cons

  • There is a lot of stuff included in the package that we might not use.


Symfony


Pros

  • Very modular - potential to scale well, provided developers write/configure their bundles correctly
  • Generators exist for a lot of stuff. 
  • Supports Composer
  • Extensive documentation

Cons

  • Code is very verbose and dense
  • Migrations are done by changing attributes on the model(s) and running an analyzer which migrates the schema for you.


CakePHP


Pros

  • Even though it’s old, it appears to have had long term support
  • Documentation is okay

Cons

  • Feels old
  • Like Symfony, the schema migrations feel awkward. The first time you generate a migration (Cake PHP calls it a "schema"), the library creates "schema.php". Subsequent calls to generate a new schema will create "schema_2.php", etc.
  • You start a new project by downloading their source and untarring it


Summary

It is Curve's opinion that Laravel is the best choice for smaller projects that require access to a database. It and Symfony are very similar in terms of architecture, but we found Laravel to be much easier to get up and running with. There is some complexity around Bundles in Symfony, but other than that, it was the only other framework we could get a very simple app up and running with in a short amount of time.


2 comments:

  1. You tried Fat-Free Framework? (http://fatfreeframework.com/home) - it's small and you can use the bits that you want from it. For a small project you could even use it just for routing..

    Worth a look for sure!

    ReplyDelete
    Replies
    1. Thanks for the suggestion, we'll check it out.

      Delete