views:

1479

answers:

2

Hi,

I keep on reading how great codeigniter is from a development standpoint. And I am sure that using the framework will make the development process quicker. But the question I ask myself is, will there be a difference to a individually made framework, which caters to your needs?

Is CI, despite the advertised small footprint, going to "bog" down the system because it is basically a framework on a framework (the later referring to PHP as framework of C)? Are there good ways to spread the load? Are there any large applications in the wild that have been made with CI?

Thanks Casper.

+5  A: 

This really is a question that only you can answer. When you speak of a "large system", you could mean something largely used (by pageviews / etc.), or something that encompasses a huge set of business rules, but used only by a few people. Does the application need to be fast, or can you load balance it across multiple servers?

Your "PHP is a framework on C" comment is fairly out of whack, IMO. No, PHP isn't as fast as C. But it's a LOT better at handling web requests. PHP is used in some of the biggest sites in the world -- Facebook was originally written entirely in PHP. Yahoo uses PHP quite a bit. So PHP is fast enough for just about anybody, especially considering that the database will almost always be your bottleneck. If your PHP applications are slowing, you can use memcache / load balancers / put more application servers on your network. Pretty easy to scale the PHP end of stuff.

What I can tell you is a brief comparison with other frameworks. I've used CI in limited deployments, mostly helping out other people, but what I have seen, I've liked. It gives you a speed-in-runtime advantage over something like CakePHP, but it will increase your development time (as Cake's biggest strength is it's ability to rapidly develop and deploy). Speed-wise it feels pretty comparable to Zend or Symfony, which is still about 5-7x slower than just writing the raw PHP yourself.

To sum the various frameworks (NB: my opinion below):

  • CakePHP is great for rapid development. It's performance is the worst of the major frameworks, although the 1.3 release (coming soon!) is supposed to get you a free (no changes in the API, they're just removing the PHP4 support) 25% speed boost. It's focused on ActiveRecord, and is super fast to get a full featured site up and running (seriously, seriously Rapid Development / Prototyping chops).
  • Zend is the most widely used. It has the most flexibility with its addin modules. It's super fast, although not particularly lightweight. For an enterprise project, I'd go with this one or symfony. Feels like using a buncha different libraries to me. And their naming conventions are a little onerous...
  • Symfony - see the Zend comments. Although symfony is supposed to be even more enterprisey.
  • CodeIgnitor is the new hot kid on the block. Its focused on staying out of your way while still being a "framework", i.e. a tool that will help you do your job faster. It's fast to run, but a little slower to develop.
Travis Leleu
where are you pulling all these performance metrics? I would love to see them :)
bLee
From 6 months ago. I think PMJ ran some tests earlier. http://paul-m-jones.com/blog/?p=238 . The comment about the CakePHP 1.3 speed boost was from the announcement of 1.3 from the Cake guys (http://debuggable.com/posts/Cake_3_interview_with_Nate_Abele:4a665a5e-5bfc-4e42-96ee-6d284834cda3)
Travis Leleu
+5  A: 

I'm running a codeigniter site with about 11K files.

I've heavily modified the codeigniter's basic structure for my needs. For instance I have 3 applications with 3 front controllers using the same system files. I'm using smarty as my templating engine. I have rich php web apps powered by jquery and prototype/scriptaculous. I use form validation, authentication, active record, emailing, etc. etc.

My experience so far has been very positive.

Once you get a (real) templating engine like smarty pluged into codeigiter you have all the power that you'll need for medium to large sites.

You have to think about organizing your site in to large 'metagroups' as the 'controller' structure in codeigniter expects such behavior. ('blogs', 'merchandise', 'forums', etc..)

CI is very easy to add plugins for.

The framework simplifies alot of crap you would otherwise need to hand code. It's fast, simple and configurable.

My one big complaint with CI so far is that it's not very multi-application aware. The default layout assumes you're running 1 application. In my case I have a global application with global file that can be pulled into all running applications. However, this could be solved more elegantly. Additionally you have to add a little extra fluff to switch between front controllers.

My favorite aspect of CI is the easy of active record on a MySQL db. It's dead simple to set up a DB connection and get active record queries running.

I would say that it's pretty easy to get started with. Just make sure you shop around and figure out how to plug smarty into your app. You CAN use the default 'view's of codeigniter, but the minute you need if/else logic in your templates you're screwed.

I set up a 'templates' and a 'content' area in each app that I can fill with smarty templates and static content respectively. The rest I can pull from a DB connection.

ascotan
Big CI user here. Could you clarify "the minute you need if/else logic in your templates you're screwed" please? You mean it's just messy? I agree with that.
stef
Yes, I have the same question. Messy, yes; "screwed", no.
Smandoli