Discover and share the best of the web!
Learn more about Digg by taking the tour.
Rails-inspired PHP frameworks
h3rald.com — A detailed comparison of six popular PHP frameworks inspired by Ruby on Rails: CakePHP, Symfony, PHP on Trax, Code Igniter, Biscuit and Pipeline.
- 767 diggs
- digg it
- h3rald, on 10/12/2007, -1/+7No, this is NOT a duplicate... Another similar - but less comprehensive - article [ http://digg.com/programming/5_Next_Generation_PHP_Frameworks ] has been already dugg by various people, but this is NOT the same thing. Awful timing :/
- splitbrain, on 10/12/2007, -1/+4I like your article much better. More details, pros and cons easily accessable. Good Job!
- ericthedude, on 10/12/2007, -0/+1I agree, this was helpful. I'm going to try cakePHP because of this article.
- Thurloat, on 10/12/2007, -1/+2yeah, this is a much better article than the previous one i dugg :)
- Beanlover, on 10/12/2007, -1/+4Code Ingiter ftw! www.codeigniter.com
Docs are EXCELLENT and learning curve is small for those with at least some familiarty with building websites using php. No bloat, source commented extensively. Great for small projects and should scale very well (no experience with this yet). - Mach5, on 10/12/2007, -0/+8http://oodt.jpl.nasa.gov/better-web-app.mov
- gusx, on 10/12/2007, -0/+1good video
- EpicSA, on 10/12/2007, -0/+1Great article.
- njfinn, on 10/12/2007, -0/+1Good read and nice info Digg++
- eddieroger, on 10/12/2007, -0/+2Not a dupe, but yeah, basically the same as the other list. Still worth the read since the pros/cons are good.
- altjeringa, on 10/12/2007, -5/+3Can't figure why he keeps listing PHP5 only as a Con. Ya the $5 a month hosting providers don't support 5 yet. But 4 is a trainwreck and has been since the day it entered Beta.
- seanmc303, on 10/12/2007, -1/+4Frameworks are based on object oriented principles. PHP4 has a bastardized form of OOP. Why would you choose a framework that has to degrade its self to the horrible OOP standards of PHP4? PHP5 in my opinion has a pretty good implementation of OOP. Be smart and choose a framework that only supports PHP5. Support for both PHP4 and PHP5 is a bad thing.
- merreborn, on 10/12/2007, -0/+2Not only does PHP5's object model beat the crap out of 4's, but it's got tons of other new functions.
There was concern around the time PHP5 was first released that it was unstable, unreliable, and hard to migrate to. It's been years -- PHP5 is solid, and 99.99% of your PHP4 code will work fine.
The only issues we had migrating were with array_merge(), and the odd poorly written PHP4-centric library (phpdocumentator) -- PHP5's type hinting doesn't allow nulls to be passed in, so if you're running array_merge() with a potentially null array, you just have to typecast the var to an array, ala array_merge((array) $a, (array) $b); Outside of that, the transition was painless, and well worth the time it took.
Finding PHP5 packages with full sets of extensions for debian was a bit of a bitch -- you've either gotta use etch, or dotdeb.org. Turns out with the motherboad we chose for some of our servers, we had to use etch for the drivers anyway. - gwoo, on 10/12/2007, -0/+2CakePHP actaully splits the model into php4 or php5 specificially to take advantage of the features in php5. There are also several instances when we duplicate some functions in php5, but check for whether that function already exists. This is a nice strategy becuase you can benefit from the php5 functions, but not lose that flexibility in php4. On php5 CakePHP is faster, but does not do too badly on php4 either. But every now and then you cannot migrate a client. So, having the ability to develop the same application in CakePHP and know that it will deploy in either scenario is a very nice thing. For instance, we just deployed an app on a MS/IIS system after having developed it on our own Debian/Apache setup. Just had to change one define in the config file.
- seanmc303, on 10/12/2007, -1/+3I spent about 2 weeks on a quest to find the best PHP framework. I tried out most of the frameworks listed and Symfony was by far the best one in my opinion. Symfony had the best tutorials, manuals, and real life implementation examples I have ever seen. By comparison most of the other frameworks I tried, seemed juvenile when compared to Symfony. Symfony is very feature rich, powerful, and flexible. It is true that it has a steep learning curve, but there are plenty of great resources to help you out with this on their site. Every minute you spend learning this framework, is time well spent. You will never code the same again.
- gusx, on 10/12/2007, -1/+3great article but in the end everyone should at least try Ruby and Rails to realize it is doing it much better than any other PHP/Java/Python copycats.
:)- h3rald, on 10/12/2007, -0/+2That's for sure!
I recently compared just the syntax of RoR and Cake ( http://www.h3rald.com/blog/view/22/ ), and yes, Ruby is WAY more elegant and clear than PHP, that's a fact. Anyhow, since we can't change PHP syntax and way of doing things, it's nice to see that there are some ways to make your PHP application more organized.
- h3rald, on 10/12/2007, -0/+2That's for sure!
- jesusphreak, on 10/12/2007, -2/+5Do yourself a favor and learn Rails! Why?
1) Rails being the most popular MVC framework with the most backing behind it, has the most resources available and will continue to be supported well after many of these
2) Learning other languages is a good thing - it makes you a better coder in whatever language you do use - and anyone who says, "I don't want to learn another language", come on, you are a coder! Expand your knowledge.
3) Ruby is better than PHP as a language. Honestly. I've never met a single other person who worked a decent amount of time with both and thought otherwise.
Help yourself out and learn Rails. It also gives you more options to work with, which is simply invaluable.- stateofmind, on 10/12/2007, -0/+1Have you done any server-side Java to compare to RoR? I've played around with Ruby somewhat, but not enough to give the RoR implementation a fair chance, I probably will soon.
- jesusphreak, on 10/12/2007, -3/+2I haven't but there are a good amount of professional Java users moving over to Ruby.
Java is still really entranched and the defacto standard in the enterprise world, but its also much more verbose than Ruby. You can often write a Rails app in less lines of code than it would take simply writing XML to set up your comparable Java application.
Avoid Java if you can. There's really no reason to use it these days unless your job requires it. - merreborn, on 10/12/2007, -2/+2"Avoid Java if you can. There's really no reason to use it these days unless your job requires it."
That's really only true in the realm of webapps. jsp blows, but there's a wide range of other applications java is great for. - nuvem, on 10/12/2007, -0/+4Did you not read the article? There are some situations where you can't use Ruby.
In fact, right now I'm using CakePHP because my client isn't willing to change hosting providers, and nor should they have to, they're the client.
But no reason I should suffer either, which is why these frameworks were created. - lnxaddct, on 10/12/2007, -0/+2The verbosity of java is a *good* thing for enterpise projects. Regardless of how well commented the java code is, you can always walk through it because java's verbosity makes say you want to do each step of the way. I've seen ruby code written as convoluted as perl code can be... because the programmer thought he was slick. How many lines of code it takes to write something is meaningless... writing the code is just a small percentage of what coding actually involves. Rails is alright, I guess, for some projects, but there are still no offerings that have anything even close to what a java application server provides.
- jesusphreak, on 10/12/2007, -2/+1"That's really only true in the realm of webapps. jsp blows, but there's a wide range of other applications java is great for."
And there is just about always is an equivalent in Python, Ruby or some other language that isn't as verbose. Coding should be enjoyable. Java for many people isn't enjoyable. - rkalt, on 10/12/2007, -2/+1"rails-inspired"? it's not like rails was the first framework...
Does anyone have a history or timeline of all the different WEB frameworks anywhere. That would be quite interesting to see the development? I might have to try and put one together :S- jesusphreak, on 10/12/2007, -0/+3And people say "Elvis-inspired", but does that mean Elvis was the first singer?
Rails has been one of the few frameworks but put it all together in the right way at the right time. That's why it is as popular as it is currently. - rkalt, on 10/12/2007, -0/+0no but here the assumption is that these are inspired because they are also web frameworks, in some cases there's no similarity other than that - which to follow your analogy means that i could call any singer "Elvis-inspired" because they also sing and Elvis was a very popular singer ... but that wasn;t really my point - i'd be very interested in a history of web frameworks was - so lets end the ror vs the world thing here :)
- NippleNutz, on 10/12/2007, -0/+3I know you guys hate MS but isn't .Net a ASP Framework for the web?
- joelhardi, on 10/12/2007, -0/+1Symfony development does actually predate Rails. And it has a much more robust data model, for those of you who need relational table models or (gasp) need to support preexisting SQL structures.
I think what Rails really deserves credit for is being the first model-all-the-way-to-AJAX framework, because writing and debugging AJAX by hand is awful, and integrating a standalone AJAX framework into a real application isn't much better. - AmitGupta, on 10/12/2007, -0/+1> I know you guys hate MS but isn't .Net a ASP Framework for the web?
.NET is the main framework, or a platform you can say. You can do both desktop apps as well as web apps in it, ASP.NET is what you are talking about which is actually a subset of .NET.
- jesusphreak, on 10/12/2007, -0/+3And people say "Elvis-inspired", but does that mean Elvis was the first singer?
- sbrown123, on 10/12/2007, -1/+2I think Rails seen its 5 seconds of fame and 20 books a few months back. Now there are like a dozen Rails clones in different language (see Grails). Too bad since Ruby, the programming language, isn't that bad and other languages should adopt some of the languages concepts instead of the web framework.
- BioCS.Nerd, on 10/12/2007, -0/+1It's a shame you're being modded down, because I think you're right to some degree. RoR's longest lasting effect will be it's prodding of the other languages to take up the arms that modern programming has allotted them -- i.e. introspection, code generation, and having redundant work being done for you through the latter. Ruby, the language, will long outlive RoR.
- tablatronix, on 10/12/2007, -0/+1Anyone have a tutorial on "frameworks" themselves? Why should i use them ? Will they make my coding that much easier and organized ?
I write everything from scratch, although i dont write much.- rkalt, on 10/12/2007, -0/+1maybe this will help
http://discuss.joelonsoftware.com/default.asp?joel.3.219431.12
:) - tablatronix, on 10/12/2007, -0/+1Thanks alot
Thats pretty much what I figured.
fun article too :)
- rkalt, on 10/12/2007, -0/+1maybe this will help
- smuirhead, on 10/12/2007, -0/+0Does anyone have any information about overhead/performance issues with any of these frameworks?
Any examples of large apps created with any one of them?
I've been following these frameworks for a while now because I want to rework my company's medium-largish php application into a framework. My fear is that the framework itself will become a bottleneck.- h3rald, on 10/12/2007, -0/+1My site was built with CakePHP, and althugh it's not a big application it's managing fine the digg effect :P
A quick and dirty speed comparison would place the four major frameworks I examined in this order (fastest/slowest)
- Code Igniter
- CakePHP
- PHP on Trax
- Symfony
I know that Code Igniter seems to be faster than Cake ( http://www.codeigniter.com/forums/viewthread/554/ ), but keep in mind that it's a simpler framework. Similarly, Symfony may be a bit slower than the others, but it has more features and includes a lot of "add-ons". CakePHP seems a good compromise, but again, as I said in the article, I might be a little bit biased.
- h3rald, on 10/12/2007, -0/+1My site was built with CakePHP, and althugh it's not a big application it's managing fine the digg effect :P
- DivineDominion, on 10/12/2007, -0/+0Really great article! Going to check CakePHP, never heard of it before; I was about to use PHP on Trax.
Digg is coming to a city (and computer) near you! Check out all the details on our