Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP framework question

I'm currently working on a browser-based MMO and have chosen the LAMP stack because of the extremely low cost to start with in production (versus Windows + IIS + ASP.NET/C# + SQL Server, even though I have MSDN Universal). However I will need a PHP framework for this as it's no easy task. I am not restricted by anything other than the ability to run on Linux, as I will use a dedicated cloud hosting solution (and a VMWare image for development) and can configure it as needed.

In no specific order:

  1. It has to be easily scalable; this is crucial. If the game becomes a steady success it will eventually outgrow the server beyond what the host provides and would have to be moved to several load-balanced servers. It is crucial that this can be done with minimum effort. I do know this might require following strict conventions, so if you know of any for your suggested framework please explain what would be needed.
  2. It has to provide modules for all the core tasks: authentication, ACL, database access, MVC, and so on. One or two missing modules are fine, as long as they can easily be written and integrated.
  3. It should support internationalization. I think there is no excuse for any web framework not to provide means of translating the application and switching between languages without a lot of effort from the programmer.
  4. Must have very good community support and preferably commercial support as well. Yes, I do know QCodo/QCubed is so nice, but it is not mature enough for this task.
  5. Smooth AJAX support is required. Whether the framework comes with AJAX-capable widgets or has an easy way of adding AJAX is not relevant, as long as AJAX is easily doable. I plan to use jQuery + Dojo or one of them alone - not exactly sure.
  6. Auto-magically doing stuff when it improves readability and relieves a lot of effort would be especially nice if it is generally reliable and does not interfere with other requirements. This seems to be the case of CakePHP.

I have read a lot of comparisons and I know it's a really hot debate. The general answer is "try and see for yourself what suits you". However, I can't say it is easy for this task and I'm calling for your experience with building applications with similar requirements. So far I'm tied up between Zend and CakePHP by the general criteria, however, all well-known frameworks offer the same functionality in some way or another with different approaches each with it's own advantages and disadvantages.

Edits:

  1. I am kinda new to MVC, however, I am willing to learn it and I don't care if a framework is easier for those new to MVC. I have lots of time to learn MVC and any other architectures (or whatever they're called) you recommend.
  2. I will use Zend as a utility "framework", even though it's just a collection of libraries (some good ones though, as I have been told).
  3. Current PHP contenders are: CakePHP, Kohana, Zend alone.
like image 614
CMircea Avatar asked Mar 04 '10 06:03

CMircea


2 Answers

I see you have looked at Zend and CakePHP, but I would like to point you in a different direction.

http://kohanaphp.org/

Kohana is what I would use if I am was still using PHP. They took CodeIgniter and forked it in a way that makes php feel much less file-based and much more object-based. They have a great templating solution, and also have modules for everything you discussed except for ACL (I don't know what that is so maybe they do have it).

Anyway, I think it is worth checking out.

On Scalability
I noticed some conversation on speed. Although I think Kohana handled things very fast for us, I don't think this as much something to do with the framework as it has to do with other tools.

First I have increased speed on many of my php apps by dropping apache for nginx. Nginx with PHP running as fastcgi is much more light-weight and really increased load times for http://ukclasslist.com. We still use apache locally and the copy running on our server is quicker than our local version.

If you are still having trouble with speed, especially with grabbing large chunks of data you should look into memcache.

like image 142
sammcd Avatar answered Oct 23 '22 20:10

sammcd


I'm pesonally a fan of Kohana. I've CodeIgniter prior to this and Kohana (as I see it) is essentially all the good stuff in CodeIgniter without a lot of the limitations. v3 is the latest version of Kohana and is more robust and flexible than v2.

Performance varies depending on how you're using a framework and its own inherent strengths and weaknesses compared to other frameworks. Your best bet is to use APC (soon to be part of PHP 6) or eAccellerator to cache the compiled PHP scripts.

like image 40
hiddentao Avatar answered Oct 23 '22 20:10

hiddentao