views:

2560

answers:

15

I currently use CodeIgniter for an MVC framework in PHP because it's a very bare framework, is there anything even more bare than CodeIgniter?

+1  A: 

Is there a reason you are looking for anything lighter? I personally found code-igniter to be too low-key and it simply doesn't do enough for me - which is the purpose of a framework anywany. Also, I didn't find its code quality to be in the same class of other profilic frameworks such as Zend's and Symfony.

Eran Galperin
I have not needed to use most of the functions of the framework, the MVC however is useful because it separates layout from processing.
Teifion
You can use Zend's then, which is modular - you can cherry pick only the components you want to use.
Eran Galperin
@Eran Galperinwhich features of zend / symfony do you use that you found lacking in codeigniter? (for interest sake)
Owen
I use mostly Zend's - The MVC, Db, Caching, Mail, Date, Authorization, Session, Filter / Validate. For some projects I use for some less - its modular architecture is very effective.
Eran Galperin
And regarding code igniter - I just didn't like what I saw in the source code (when I use a framework I usually dig in the internals).
Eran Galperin
CodeIgniter looks very well coded to me. And very well documented. Zend, Cake and others seem way too "heavy" for most projects.
pbreitenbach
The problem is Zend Framework is a complete dog for performance and is quite complicated compared to CodeIgniter. In my experience with the two, I found myself much more productive with CI than ZF; there's no point boasting about the "code quality" of ZF when it just eats your processor cycles and is slower to build apps with.
Flubba
+19  A: 

There's always Rasmus Lerdorf's "No-Framework MVC Framework". That's about as "light" as you can get.

CapnNefarious
Popular or not, that's a pretty frivolous answer. Presumably people are voting against frameworks, which is not what the OP asked
Flubba
+7  A: 

You probably want to roll your own solution. I've written a small set of php pages that uses MVC (kinda) as controller/view scripts, a set of functions for data retrieval and a central index.php script to map urls to the proper files.

Of course, a good question is why do you need anything lighter? If you are having performance issues, I doubt a lighter framework is the solution.

epochwolf
Heh, that's a good point, since lighter doesn't always mean lighter on resources. Might mean lighter on maintenance though, I suppose.
Tchalvak
+2  A: 

From what I can tell, CodeIgniter is about as light as they get for PHP frameworks. I've tried it out a little and found it to be reasonably fast compared to CakePHP.

From reddit links a few months back: PHP framework comparison benchmarks. With caching, CodeIgniter handled about 1/3 fewer requests/second than bare PHP vs. 1/10 with Zend and 1/50 for CakePHP. Depending on traffic levels you're expecting though, any of these may work just fine, and easier development may be worth the performance hit CakePHP comes with.

Randy
Thanks for the link! :-)
Christian Davén
+2  A: 

Based on your question, I'd say you should try to create an MVC patterned app using just PHP/MySQL.

I think you'd gain a lot of valuable insight, and it would probably generate much more specific questions.

Pete Karl II
+9  A: 

make your own! it's fun!

Galen
It may not be feasible though.
conmulligan
I started building my own framework, but eventually got frustrated re-inventing the wheel, I started using Code Igniter and found I had learnt a lot from my own developments.
Jon Winstanley
+12  A: 

I've been using LightVC a lot lately and it makes CodeIgniter look like a heavyweight. Beware that it's just a view-controller framework. If you want some kind of data access support, you'll need your own ORM layer. I've been using CoughPHP for that. It's written by the same guy and fairly lightweight as well.

Now keep in mind, LightVC and CoughPHP give you MVC only. No helpers, none of that. Just basic MVC organization and routing. In my case that's exactly what I wanted. From what you've described it sounds like it's exactly what you want as well.

Bob Somers
+2  A: 

You could use something like TinyMVC or the already mentioned LightVC or you could use an ORM such as Doctrine for the Model and a template system like Smarty or Dwoo for the Views and for the Controller you could use Zend_Controller or Horde Routes

ejunker
+1  A: 

I have seen tinymvc Although I haven't used it yet.

Thorpe Obazee
+1  A: 

Facing the same question, I wrote my own.

At 400 self-documented lines of code, it has a nice view/controller relationship and some helpful model functions. I put a task management app I'm building into it, so you could svn that down and look at it if you like.

Dean
+1  A: 

You could also try using phpDataMapper as your Model layer. The entire codebase is under 100k, uncompressed.

Vance Lucas
A: 

The lightest View-Controller framework that I'm aware of it's called Doo and it's made by me. :P

Alix Axel
+7  A: 

How about my tweetable "framework":

$g=$_GET;$c=@$g['c']?$g['c']:'Home';
if(!@include"c/$c.php")die('fail');
$m=method_exists($c,$m=@$g['m'])?$m:'index';
$o=new$c;$o->$m($g);
Phil Sturgeon
A: 

I have been working on a MVC PHP web development framework and it is initially very light. You can add extensions to the system in a latter stadia if you need to.

You can check it out it's called the RDS Framework

It is open source and there is a nice documentation and some video tutorials to get you started.

Saif Bechan
A: 

It seems like everyone and their mother is building a PHP framework these days. I too have hopped on the bandwagon with my own framework: Sonic.

The Core framework clocks in just under 1000 lines of code (~21kb) and handles routing to controllers and actions (views), using layouts, rendering views within views, etc.

You can also set an App Delegate class to receive events as the application runs, and it has a native implementation of Facebook's Big Pipe.

Beyond the core stuff there is also an extremely light ORM as well as database and cache layers.

http://www.sonicframework.com/quick-start

Craig