views:

1489

answers:

4

Hi everybody,

I have used codeigniter for a some years now. Why I chosed to work with codeigniter back then? Pretty much for the extensive documentation that were available and the big user community. It made me as a totally newbie to the MVC pattern able to get a site up and running really fast.

I think what is priorited from my side is that the framework doesn't affect performance too much, which Codeigniter seems to be pretty good at (when compared to other frameworks out there) and Yii, an even better option.

Since the time has gone from when I started out with codeigniter, the project sizes have also increased and thereby the demand of the framework and it's footprint on the code. I have thought a few times about writing a whole new MVC framework to do only the thing's I want it to do, but it feels like reinventing the wheel and I cannot yet justify it.
I am not sure whether or not it's a good solution to build a site that have the potential to become really big on either Yii or Codeigniter.

I have tried to find as much as possible documentation about this comparision/issue online before posting here, but have found very few real-life arguments and stories from people that have shifted between the two PHP frameworks or have been in the same situation as me.

So - what's your thoughts about Codeigniter vs. Yii vs. going custom?

References:

+2  A: 

I'd go for a No-framework PHP framework but using and ORM for data access, I particularly like Doctrine. Not to appeal to authority or anything but this article by http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html by Rasmus Lerdorf, might shed some light.

Now to make an argument for my approach, with apache, mod rewrite and the __autoload function, it's easy to bootstrap the code for loading actions from controllers automatically. All you have to now do is create a directory structure. You don't need tones of line of code to accomplish that.

For specialized libraries, one can actually use Zend Framework as a library, picking only the classes you want. In the end, you have a light application.

In my opinion you don't need to write much for a bootstrapped custom framework. Just add your include paths, define your __autoload functions, make a class to safely render views, and pass variables to them, and an abstract/virtual controller class, letting the ORM handle the models. But then again, for a large application you probably don't want any ORM or eve PDO, and you will use the basic database functions making your application very unportable across database servers. Point is, it's easy, and I have done it for 2 different systems, and it turned our well.

Still if I had to to use a framework, I'd say Codeigniter, reason, community. For a big application I'd use symphony

partoa
Hi Partoa. Thanks a lot for your great and extensive answer! Can you tell me about why you'd prefer symphony over CI for a larger app?
Industrial
Symphony is designed to be scalable and complex application, well at least that's their stated goal. Also the users, http://en.wikipedia.org/wiki/Symfony#Real-world_usage, seem to be quite a number.But to be honest, I have never used it, I use Zend Framework at work, but I found it that way.
partoa
+1  A: 

I've moved from CI to Yii with an attempt to write my own solution. Yii was a very good move because it had all I missed in CI and I was good enough with MVC to learn Yii.

Sam Dark
Hi Sam! Can you tell me more about what You had missed in CI?
Industrial
AR with proper models, layouts support, user access control, proper autoloading, forms validation, widgets… maybe there are more.
Sam Dark
+1  A: 

I think I should stick to the tools and learn more about gaining performance from NoSQL instead of changing php framework because CodeIgniter is fast enough to do big website.

Ex. You should try to learn about Key-value store like Redis instead of Memcached. You should try to learn MongoDB instead of MySQL. You should try to learn Three-Tier Web Architecture.

It has a lot more way to gain performance for big site. Not only PHP Framework can solve all this problems.

DominixZ
Hi DominixZ! Thanks for your post. Already utilizing memcache + redis and have done some test runs with CouchDB + MongoDB :)
Industrial
Do you use Varnish for reverse proxy? I think if you use that and your architecture doesn't scale enough. I cannot answer you more =).
DominixZ
+3  A: 

Vote for Yii!

I spend few weeks on research what framework should I stick with for my future projects. It is a huge waste of time - learning a single framework! So I though just like you: why should I re-invent the wheel? I tested (or read reviews) on CodeIgniter, CakePHP, Doctrine, Cohana, Symfony, Propel, AgilePHP, Zend Framework, and compared all that to my own framework (which I have worked on for cca 2 years) and came to following conclusion:

What I need is:

  1. performance,performance, peformance
  2. SQL engine support based on PDO (NOT only mysql, but also mssql, oracle and pgsql)
  3. API friendliness
  4. integrated JQuery
  5. documentation

Here is my TOP 5 on all frameworks:

  1. Yii - genial architecture, PDO based SQL management, security, JQuery, documentation etc
  2. Cohana - is advanced Codeigniter rewritten into PHP5, however bottleneck is SQL storage management
  3. Code Igniter for beginners
  4. CakePHP for advanced developers with good opcache on hosting production server
  5. Symfony with Doctrine 2 model for heavy industrial projects and good opcache

And i dropped developing of my own framework, since the wheel named Yii is rolling far ahead of me:-)))

regards Lubos

lubosdz