

Railslike PHP Framework: Code Igniter - jdavid
http://codeigniter.com/

======
jsdalton
I've used CI on several projects. I've also used Rails. Here's my take on CI.

The good stuff:

* GREAT documentation * Code was designed around performance, and it is pretty darn quick. * PHP4 based. (This, btw, is only a plus for a tiny few people. There's no need to be on PHP4 any more.)

The bad:

* The "model" layer is not really an ORM at all. It's just a slightly fancy way of wrapping SQL statements. This is better than no separation of concerns, but it's not really an object oriented way of accessing the model layer. * It misses out on all the great things that are going on with PHP5. * It's open source but privately developed. The pace of evolution is glacially slow, and decisions about the direction of the framework are made closed doors.

To me, CI is a HUGE advance over throwing code together in php files, but it
doesn't really have enough abstractions to qualify as a true MVC framework.

If you do decide you like CI, check out kohana php. This is an open source,
community developed fork of CI -- that's built for PHP5.

For what it's worth, I'm far happier coding in Rails (and the little bit of
django I've tried), and would probably recommend those if you're not afraid of
abandoning php.

------
drm237
<http://coordinatr.com> is built on CodeIgniter. CI has some of the best
documentation of any Framework and it's super fast compared to others like
CakePHP and Symphony. Of course, it's still PHP so there are some limitations,
but overall it's been great.

I don't really like the Rails comparison that people make. It's PHP and it's
significantly less "magical" than rails.

~~~
jdavid
but Rails made MVC extremely popular, and the directory structure and admin
function names are very similar (at least from a non rails user like my self)

~~~
drm237
Very true. The problem I have with calling it a rails clone is that people
expect things like scaffolding, ORM, and auto code creation. CI has
scaffolding, but it's only for admin use, not production, and while there are
libraries that can do the ORM and code creation, they aren't as well
integrated as Rails. Still it's lightweight and fast which is why I use it.

~~~
jdavid
i think the differences are more based on the "base" install rights of ruby,
vs, the base install rights of php.

many php servers do not have the option to run a cron job, and i think ruby
can hold a state, where php runs the script for each request.

~~~
drm237
Are you talking about shared hosting packages? I think judging a language or
framework based on the shared hosting packages available is probably one of
the less effective arguments...

------
jdavid
I found this from 4braham in Madison, WI. the framework videos make it look
exactly like rails, but in PHP. i think its pretty neat, but if i was going to
use it i would still have to abstract a custom MODEL for it, because we are
using S3 as our data store. I might code my datastore towards their model if
this becomes a popular framework.

what do other YC'ers think about Code Igniter?

~~~
jamongkad
Frankly I love it. Compared to other PHP frameworks I've used I think CI's way
of doing things is pretty straight forward (but I suspect that Symfony comes
close). Although I some qualms on how it uses validations, how CI's model
implementation is different from Rails(personally it's not as magical as Rails
implementation but I dig CI's more).

So I decided to tinker with the framework and fork my own implementation.

My framework is now built on top of CI and is able to use functional
programming idioms such as anonymous functions and the like. Pretty awesome
stuff.

~~~
apgwoz
Functional programming in PHP? How? And, is it efficient? I know PHP has a
callback mechanism, but am more curious about the anonymous functions claim...

~~~
jamongkad
Well basically I found this old library in PHP created by Ian B,Kos. His
library allows certain functional programming idioms using PHP. What I
basically did was fix the library up in order for my version of CI to utilize
the library.

Is it efficient? well according to the original author you take a minor hit it
performance (as of yet he has not provided any solid numbers) in exchange for
programmer happiness.

The implementation of anonymous functions is quite clever. Please consider
this library was created 4 years ago and has remained stagnant up until now.
To put it shortly he uses a eval based approach in order for use of anonymous
functions.

~~~
apgwoz
Care to share? Or at least point me to the original library? I had found a few
things <http://ioreader.com/2007/05/03/php-closures/> and
<http://www.steike.com/code/php-closures/> a while ago...

~~~
jamongkad
well I tried going to the original site and unfortunately it seems to be down.
Tell you what maybe we can connect via email or chat or something. I can hand
you the original source code of the library. Be aware though it's not the most
elegantly documented piece of code. But it's commented heavily and you can
learn a great deal of how PHP works and how the author worked around it's
limitations.

~~~
apgwoz
My email address is in my profile, which I believe pg said at one point users
can see if they are logged in. If not, let me know. Edit: The sample of 5 i
checked didn't show an email address... It's my username here at google's
service.

~~~
jamongkad
Did you get my email yet? I'm not sure if the email address that's on your
site is the right one.

------
jasonlbaptiste
just started reading up on it. Glad to see people building on it. btw, @jdavid
if you find/build a model + plugin that works with s3 easily, that would be
awesome. I think you might just have to mod their file upload mod btw.

~~~
jdavid
Right now i have customers that want to pay me, but i don't have a back end. I
would love to just get something done now in prototype, so i can build a real
nice MVC later on.

in the "RAILS MVC" pattern i have only tutorial experience and now the code
ignite tutorial behind me. I come from a C# world, so a lot of this is still
new to me. We decided to move from C# because php5.2 is so awesome, and mono
was becoming a scary rabbit hole. Code Igniter is an exciting idea.

I am curious what the best way is to extend a model in CI. it looks like a few
days work just to think about it. i think if we bring in 4braham in Madison,
WI we might be able to build a decent set of classes though. ThruDB also
launched today for ubuntu, so i would like to build in the hooks for thrudb
and memcache on s3 objects so that it is built for scalability and simplicity.

------
andr
That's a PHP4 framework. It's a bad idea to use PHP4, because 5 has so many
useful new things, performance improvements, SPL, etc. In the OO area, PHP5 is
practically a new language.

~~~
suboptimal
Are you looking for a PHP5 version? Here's a fork:

<http://kohanaphp.com/>

Haven't tried it yet.

------
henning
The Rails imitators always seem to be like Elvis impersonators: some are
better than others, but none are ever quite as good as the original.

~~~
jamongkad
True but I think CI is evolving to be something else aside from being just
another PHP rails clone. (Well that's what I'm trying to attempt with my
forked version)

