Picking a PHP Framework
January 5, 2010 3:49 AM   Subscribe

I'm looking for some help in picking a PHP framework.

I'm about to start updating an existing spaghetti code web application and a framework seems the way to go for various reasons. However, I don't have masses of time to evaluate every option out there (especially as I suspect most of the things I find important would come out late on in the process: a lot of blogs evaluate based on "Hello World!" applications, and I don't know how useful they are as a basis for comparison).

The key features I need are:

- Speed (of performance)
- Security
- Good documentation and community support
- Durability (the lifespan for this website will be pretty infinite - it's a ten year old site already - so in, say, seven years time will the project still be improving/growing)
- Flexibility (I hate, hate, hate running up against the limits of things)
- Relatively easy to pick - this will be my first time explicitly working with MVC etc. I don't mind a learning curve but after I've been immersed in it for a bit I'd like to feel I've got the hang of it.

One of the things we'll be doing with the rebuild is creating a public API, so a framework that helps with that would be a bonus.

More background: it's needed for a website in which users login, enter data, view and compare data with other users, and therefore there's mild social networking features (for want of a better phrase...). There's a lot of database queries going on so good db features would be appreciated.

At the moment, the three that seem most likely, and my first impressions, are:

- CodeIgniter (good support, slightly dated being PHP4 compatibile, a lot of people seem to be moving away from this now)
- Kohana (seems more advanced and 'better' that CI, but am disturbed by their Tutorials page being over a year old. Not clear how big and stable the project is, or whether to start with version 3 or the current download of 2.3.4)
- Yii (seems to tick a lot of boxes, but not clear how big the community is)

Any help much appreciated!
posted by Hartster to Computers & Internet (7 answers total) 2 users marked this as a favorite
 
I've had good luck with CakePHP.
posted by cerebus19 at 4:57 AM on January 5, 2010


Any particular reason you're discounting Zend, Symfony and CakePHP?

Arguably, they're probably the most popular frameworks. If you're worried about longevity, I would probably go with Zend.
posted by purephase at 4:59 AM on January 5, 2010


I use Zend Framework at work.

Quite verbose, sometimes unwieldily but very flexible and contains support and helpers for almost anything you'd want to do.

Documentation is average, community is enormous and DB layer isn't that great but the whole thing is quite pluggable so you can fairly easily drop in Propel or Doctrine.

Also, we've had some trouble finding IDE's that work nicely with it. Zend Studio obviously does but it's quite expensive. Komodo & PDT have limited support for it but it's better than nothing. I'm currently using Textmate with almost no IDE features so it's not really a biggie.
posted by puddpunk at 1:24 PM on January 5, 2010


I've used CodeIgniter, CakePHP, Zend, and built my own quite a few times, and... well, CakePHP is a pretty good deal. I like how it's very minimal and how the central hub/community/website is quite well-run.

Two things actually don't matter much: the speed of the framework is usually negligible, relative to the O(n^3) loops web developers occasionally write. And if it's a high traffic site, you want a great caching solution, which is not going to be PHP at all.

Zend made me feel weird using it. Random huge lumps of code, and then the 'framework' parts were different than the rest. Give me a router, cache, db models, and templates. It's not rocket science*

* actually it is.
posted by tmcw at 2:16 PM on January 5, 2010


(oh sorry, the second thing that doesn't matter is security; these frameworks aren't going to expose security problems, your authentication logic will. use openid and hash your passwords please)
posted by tmcw at 2:17 PM on January 5, 2010


Response by poster: Any particular reason you're discounting Zend, Symfony and CakePHP?

From my reading, the reasons were complexity for a newbie (Zend, Symfony) and speed (CakePHP).

I can sorta see tmcw's point with regard speed, though I'm not sure how far I agree.

With regard security: one thing I like about Yii (and CakePHP for example) compared to CodeIgniter is it has Auth/ACL built in. one of the reasons I want to start using a framework after a few years out of PHP is to avoid another round of writing login routines and "forgot password" pages and passing user data and avoiding XSS etc.

I dunno. It's annoying. I don't want to waste time going too far down a blind alley, yet neither do I have time to fully evaluate various solutions (on top of getting the hang of MVC itself).

Maybe I'll have another look at CakePHP.
posted by Hartster at 5:10 PM on January 5, 2010


Yes, look at CakePHP.

Also, I'm working with some developers on a site running on TYPO3 and I'm darn impressed with how it's shaking out. Not sure if it fits the bill for all your requirements, however. Definitely take a few minutes to ready up on it.
posted by quadog at 12:05 AM on January 6, 2010


« Older Japanese Translation   |   Pimp my office Newer »
This thread is closed to new comments.