4 ms·
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 clos
by jamongkad 19y ago
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 19y agoFunctional 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 19y agoWell 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 19y agoCare 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/ http://ioreader.com/2007/05/03/php-closures/ and http://www.steike.com/code/php-closures/ http://www.steike.com/code/php-closures/ a while ago...
- jamongkad 19y agowell 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 19y agoMy 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 19y agoDid you get my email yet? I'm not sure if the email address that's on your site is the right one.
- robdor 19y agoNo, 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; '); }