views:

1252

answers:

15

Hello all,

I have asked this question before (didn't get a definite answer) and have read a lot of similar questions to this and I apologize to those getting tired of these sort of questions. :)

I have a fully working PHP web project using my half pint PHP skills in a procedural way. But its not up to scratch at all. It can break at any moment!

I will be rewriting the web application (50+ scripts). I want to do this quickly (RAD?) and properly.

About the Project

The project will be making use of FFmpeg heavily, it will be making use of cron jobs and sending many emails per day. I aim to have 100s of thousands of users (doesn't everybody). The project will also make use of Flash components external web services.

About Me

I haven't used any PHP frameworks before but I am well versed with OO concepts. I am really looking for a framework that can add value to my code since my PHP scripting isn't so "hot".

PHP Framework Requirements

I need a PHP framework that meets the following requirements:

  • Easy to learn
  • Rapid Development
  • Lots of Modules
  • Light and Fast

I want to complete this project properly. I even have a fresh install of Fedora so I can develop in my production environment.

From reading around, it seems that CakePHP, CodeIgniter and Zend are what I should be choosing from? But I can not narrow it down any further since I have not used any of them.

It would also be great to here from peoples personal experience of using these frameworks as it may help me or others that want this sort of question answered in the future.

Thank you all for any input.

+4  A: 

Personally I prefer CodeIgniter from what I have seen. I think its important to be good using PHP before using a framework. I have been coding PHP using only Notepad, It really helps you understand how the language works. Only my opinion.

Frameworks can be confusing so it would help to find someone who can either guide you or give you some helpful advice. I have researched frameworks before and CodeIgniter looks really interesting. I was about to use it but I feel my raw PHP coding should be up to par first.

Best of Luck!

Chris B.
I agree, CodeIgniter is simple to get started and makes sense. Great documentation, makes life a lot easier.
Cameron
wow! notepad for coding
jimiyash
Is that a bad wow? haha.
Chris B.
+10  A: 

I've tried a few of the PHP MVC frameworks, and I gotta say that CakePHP really stands out as the best to me. Unfortunately, there's a leanring curve with these frameworks (especially if you aren't used to MVC) that will slow down your development effort.

Ultimately, I think any of those frameworks will be fine, but you have to decide how to make that tradeoff between development time and code quality. I don't think you can have both.

mgroves
CakePHP miserably fails in the "light and fast" and "easy to learn" categories he described. It is a pain to make a site that scales remotely decently with Cake.
Paolo Bergantino
Mozilla addons site disagrees. And many other.
dr Hannibal Lecter
I did mention the learning curve, but I think that is a tradeoff you have to make for a good framework.As far as being scalable, there are some popular sites that use CakePHP, and if your site gets more hits than those, well, that's a good problem to have :)
mgroves
My vote also goes to cake. There are many references on how to scale cakephp out there. As with any framework there is a learning curve, but cakephp is the only framework that made sense to me, and I was able to pick it up very quickly.
jimiyash
+2  A: 

I would suggest the Zend Framework. I notice that you're using FFmpeg, so it involves some video processing? Any chance these videos will end up on Youtube? If so, the Google Data API is implemented using the Zend Framework.

So not only do you have Zend, the PHP company, behind the framework, but you also have Google partnering with them - a powerful, long term combination.

Plus, if you do have hundreds of thousands of users, and you know & use the Zend Framework, you can start incorporating all the other Google Data libraries for their other services.

Lastly, Zend and Google have lots of code samples to play with.

Edit: Just came across this video. Hope that helps.

Keith Bentrup
lol ... I just noticed the first 3 answers gave you 3 different recommendations from your 3 choices. ;)
Keith Bentrup
I noticed that about Zend and the Youtube API. I will be using FFmpeg but I won't be putting anything on youtube.
Abs
A: 

Just be aware that you're making a trade-off when you use any PHP framework.

First of all, you still have to learn a new "language" -- namely, that of the framework itself. This often requires learning several new topics at once before you can really make something decent, versus learning PHP directly which can provide incremental development as you learn each feature you need.

Second, more specifically -- we have a system at work which was built on CakePHP, which is currently becoming a problem. Specifically, we need to run reports which generate a large amount of output -- joining two large tables -- and we can't use CakePHP's record set handling to accomplish this. CakePHP automates the SQL connection open/close handling, deep within the framework itself. Joining the SQL data into a temporary table and then looping through the results using LIMIT chunks is the right solution, yet this requires keeping the same connection open and submitting multiple queries to it. (Temporary tables are connection-specific.) Problem is, CakePHP assumes that a new connection should be used for each query, and doesn't expose any way to simply drop the result set. On the other hand, using raw PHP, this task is trivial.

So just be forewarned that some tasks may indeed be easier, but some may be far more difficult. Unless you're going to reuse the framework components for multiple site creation, and unless you can accept limitations when the framework doesn't predict your usage needs, then I'd be wary of this solution.*

Disclaimer: My aversion is admittedly somewhat CakePHP-specific; other frameworks may do a better job at second-guessing my needs. But then, I don't want something which will second-guess me in the first place... hence my initial "raw PHP" inclinations.

DreadPirateShawn
I believe that you can change the behavior of the database in app/config/database.php so that it uses a persistent connection. Anybody?
Travis Leleu
I think there's a tendency for people to limit themselves to the default behavior of the framework, and get frustrated when it doesn't meet all their needs out of the box. This is one of the reasons I like Zend, it prides itself on being modular and easily extended.
Bryan M.
@Travis -- Looks like "'driver' => 'mssql|p'" or "'persistent' => 'true'" is what you're referring to... I'll have to check into that, thanks!@Bryan -- As for people limiting themselves to the default behavior, you're absolutely right. But more importantly, people can be limited to the default behavior via knowing raw PHP but inheriting a large CakePHP project to maintain. It's unfortunate when you know how to do a task by hand in an hour, but your "helpful tool" requires an extra week or two of learning curve. In a deadline-focused project, that's often not a viable option.
DreadPirateShawn
A: 

If you want fast, simple and lightweight, and want to try something new, I've just released a framework called EuropaPHP (http://europaphp.org/). It doesn't come with many libraries (by design) but you can drop in the Zend Framework without any configuration at all. If you have any questions, my contact info is on the site.

If not, then I'd recommend the Zend Framework. It's solid, has a good documentation and a decent community behind it. However, ZF is one of the slowest frameworks out there with CakePHP being the absolute slowest, but it vast library overcomes it's speed.

All that being said, it sounds like you are going to need a fast, resource-friendly framework while still having access to a solid library. For that I recommend the Europa/Zend combo.

Tres
+1  A: 

I love coding with CakePHP, but I'm afraid that it's a little slow. Or at least it was the last time I tried it (I think it was the first 1.2 release). Another bad thing with CakePHP is the lack of proper domain classes. Instead of classes and IDE autocomplete goodness you have to struggle with huge arrays.

Kimble
Turn off debug mode in core.php and you'll get a nice performance bump :)
mgroves
That's true, but it's still a lot of overhead
Kimble
It is possible to get autocomplete in Eclipse and other IDE with a small comment at the top of the models
jimiyash
A: 

I'll put in another vote for Zend. It really is more a collection of libraries than a all-inclusive framework. It makes it really easy to pick and choose the pieces you want, as well as incorporate third party libraries. While I can't compare to others, I believe Zend is extremely well written and documented.

However, for RAD, if you're not using another framework's ORM I would absolutely recommend the Doctrine ORM. Its very high-level, and is heads and shoulders above Zend_Db for quickly producing models. It even has an excellent SQL query-building framework.

I think all the major frameworks (Zend, Cake, Symfony, CodeIgniter) do a fine job. It's probably just a matter of finding the one that fits your personal belief in what a framework should be (or what fits your ultra-special needs).

Also, as for not using a framework, I tend to believe that most people who choose not use one are doomed to reinvent them, poorly. You can write good solid PHP and use a framework, they're not mutually exclusive.

Bryan M.
+1  A: 

I've only used Code Igniter, but I looked at Cake, Zend, and a few others when I was considering what to learn. Code igniter has very good documentation and is simpler to learn than the others. The flaw of Cake (at least when I looked at it), was the poor documentation. Zend is well documented, but has a steeper learning curve (in my opinion).

I like the simplicity of Code Igniter.

me_here
Agreed. Great documentation, very lightweight.
GloryFish
+1  A: 

I would use CI when "light and fast" is needed. Otherwise Zend is the right answer :) CakePHP seems to me more like premade CMS backbone :)

Tomáš Fejfar
A: 

CakePHP can be light, fast, and scalable, depending on how it's written, and would have the advantage of helping you to write better PHP. It also has pretty decent library support. Cron job emails require a workaround, however.

Code Igniter may be better because it is a simpler framework - simpler in that it does less, but also has less overhead. It might be easier for you to learn given that you've dealt little with MVC and frameworks in general, and it's better beginner documentation (experienced Cake developers go to the API, which is nicely web accessable, but hard to start with).

I have little exposure to Zend, but have heard it described as more a library than a framework (though library files needed to act like a framework are present among them) - if you like more the feeling of building things from a set of libraries, Zend might also be a better choice.

Overall, I would personally recommend Code Igniter because it is the lightest of the three, and does the least for you automatically - which allows you better control over the code at the cost of marginally increased development time.

michaelc
good comparisons.
jimiyash
+2  A: 

Why not find out yourself? All frameworks come with documentation and examples. Usually the example is a simple blog with a Post and Comments module. It's a reasonable example as it is simple and contains a relationship between the two models.

Try implementing that in all three frameworks. It shouldn't take you more than a few days. You will be in a much better position to judge for yourself what the advantages and disadvantages of the frameworks are.

All the frameworks you listed are good frameworks to use. Picking one is a matter of personal preference. A little experience can go a long way.

Sander Marechal
+1  A: 

I recommend symfony. It is easy to learn yet increadibly powerful and scalable. Yahoo, for instance, uses it in several projects as Yahoo! Answers. It has a large community and it's well documented. You should try it; check this tutorial: Jobeet

miguelSantirso
A: 

CodeIngniter ... The best one: Light, fast, scalable, Eesy to learn and quit simple.

A: 

CodeIgniter will be the best option for Ease of Learning, Rapid Developing and Light and Fast. CodeIgniter has plenty of modules so it's hard to say if they will meet your needs or not. I have found Cake & Zend to be much too "heavy" for most projects. And both having a major learning curve.

pbreitenbach
A: 

How about DooPHP? It is just released, see the benchmark . It might be the fastest PHP framework!