News for hackers. Stuff that matters.
Re:Railslike PHP Framework: Code Igniter by jdavid on Thursday March 20, 2008 @10:50AM (#141636)
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?

Re:Railslike PHP Framework: Code Igniter by jamongkad on Thursday March 20, 2008 @11:38AM (#141666)
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.

Re:Railslike PHP Framework: Code Igniter by apgwoz on Thursday March 20, 2008 @12:17PM (#141705)
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...
Re:Railslike PHP Framework: Code Igniter by jamongkad on Thursday March 20, 2008 @12:41PM (#141728)
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.

Re:Railslike PHP Framework: Code Igniter by apgwoz on Thursday March 20, 2008 @12:59PM (#141741)
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...
Re:Railslike PHP Framework: Code Igniter by jamongkad on Thursday March 20, 2008 @01:34PM (#141771)
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.
Re:Railslike PHP Framework: Code Igniter by apgwoz on Thursday March 20, 2008 @01:57PM (#141790)
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.
Re:Railslike PHP Framework: Code Igniter by jamongkad on Tuesday March 25, 2008 @06:22AM (#145578)
Did you get my email yet? I'm not sure if the email address that's on your site is the right one.
Re:Railslike PHP Framework: Code Igniter by robdor on Thursday March 20, 2008 @02:20PM (#141811)
No, php's implementation of anonymous functions is not efficient. When create_function is called it stores that created function globally which doesn't allow garbage collection. Making it pretty much useless to use in callbacks or when defined within a loop. Watch the memory increase for the following test:

while (true) { create_function('', ' return 0; '); }

Re:Railslike PHP Framework: Code Igniter by mk on Thursday March 20, 2008 @12:57PM (#141739)
We are currently using CI on a pretty big project and I have both good and bad things to say about it. The good news is that it is a "rails like" framework, but without the magic. Some of the helpers are really nice, the validation lib is pretty nice allowing for callbacks to both validate and alter data. Problems I have with it are support for transactions, which seem to be there but fail miserably when something goes wrong. If an exception is thrown the transaction has begun but it never hits a rollback, so all those queries are hanging in the balance and never get commited or rolled back. There is also this recurring theme in CI that they had to do everything themselves. This means that instead of using a well established Email lib they wrote their own, which has severe limitations. You can extend these all of these classes and easily integrate others so Email wasn't so big of a deal. We are just using phpmailer instead. You cannot however extend the DB class. You have to hack up the original, which is what we have been doing to provide SQL queries in the log file during development, and transactions that actually work. This wasn't too bad to do, but it is already introducing a problem. Upgrading from 1.5.whatever to 1.6 breaks the modifications that we did. So now we have the problem of versioning our own copy of CI with our fancy DB stuff, and the actual product we are developing. That being said it is the best PHP programming experience that I have ever had.
Re:Railslike PHP Framework: Code Igniter by jamongkad on Thursday March 20, 2008 @01:40PM (#141777)
The validation lib can be improved upon but I just hate the idea of sticking into a controller function (I just move it the model, currently I'm writing a lib that should remedy this). Still I have to agree that allowing callbacks is a nice feature.

Quick question how good is PHPMailer compared to CI's native Email lib? Was planning to use the latter for our company's web app.

Re:Railslike PHP Framework: Code Igniter by drm237 on Thursday March 20, 2008 @02:18PM (#141806)
CI's email library has 3 modes: PHP Mail, Sendmail, or external SMTP server. In my experience, using Sendmail is very fast if you have a mail server installed on your webserver. I haven't tried PHPMailer because I haven't found CI's mail library to be missing anything that I needed.
Re:Railslike PHP Framework: Code Igniter by mk on Thursday March 20, 2008 @06:13PM (#141988)
The reason why we started using it was we are required to send out HTML email. This sucks I know, but it wasn't an option. I found that CI's email lib had problems with sending out HTML mail with images as attachments and referencing those images in the HTML. Absolute image urls were not an option either.
Re:Railslike PHP Framework: Code Igniter by thorax on Thursday March 20, 2008 @03:44PM (#141874)
We use Code Igniter on all of our sites you see in my profile.

Love it, love it. Has its issues, but I can't really put into words how useful it has turned out to be for our team.

We may very well go with Django long-term, but I've never spent a day regretting that we're using CI. And this from a guy who has always had a fairly low hacker opinion of PHP. CI kinda changed that a good bit once I pushed back my skepticism.

I highly recommend it for PHP developers who want to move to the MVC model and get a lot of ROI on their development time.

If you're comfortable with Ruby or Python, you'll enjoy the other frameworks more, of course. But I wouldn't use PHP on its own without Code Igniter.

Re:Railslike PHP Framework: Code Igniter by drm237 on Thursday March 20, 2008 @01:27PM (#141767)
Re:Railslike PHP Framework: Code Igniter by suboptimal on Thursday March 20, 2008 @11:38AM (#141668)
Shhh, don't tell anybody--it'll just ruin it.