Ecommerce with CodeIgniter
Posted on May 15th, 2008 in CodeIgniter, PHP, Web Development, Zend Framework | 4 Comments »
Ironically the Zend Framework is marketed with the phrase “Extreme Simplicity & Productivity”. I have developed a few sites with it now and I find it to be anything but simple and productive. It’s complicated, has a steep learning curve, and (in my opinion) needs a lot more work. I realize that I’m coming from a RoR background and that is a lot for a PHP framework to try to match. Nevertheless, I am quitting all Zend Framework development until more work can be done on the framework. Then, maybe I’ll reconsider.
I have found CodeIgniter and have now built 3 sites with it. It’s simple, easy to use, speeds up development, has great documentation and, best of all, has won me as a fan. My most recent CodeIgniter project is an educational/e-commerce site about Rebounding with the Cellerciser While developing the site and reading the site content, I was convinced of the many reasons to use a Cellerciser I’ve now been using a Cellerciser for about 3 months and I love this thing!
All this is to say that I’m developing with CodeIgniter now and I’m customizing my development for PHP5. Even though CodeIgniter is not strictly a PHP5 framework (it will run under PHP4 or PHP5) it does try to detect if it’s being run under PHP5 and has several chunksk of PHP5 specific code that get loaded if you are using PHP5. Then, you can code your own models and libraries using strict PHP5 syntax – taking advantage of all the goodness that PHP5 brings to the table.
I took a day or two to look into Kohana which is basically the PHP5 only version of CodeIgniter. Kohana, being pure PHP5, has a few advantages over CodeIgniter. Here is a great reivew comparing Kohana and CodeIgniter In the review there are also a few tips on integrating the Zend Framework in with you CodeIgniter project – a much better use of the Zend Framework than building exclusively upon it.
Even though I exclusively use PHP5 and Kohana takes much better advantage of PHP5 than CodeIgniter does, I ended up sticking with CodeIgniter for the following reasons:
- Better documentation (although Kohana’s is very good too)
- I felt like CodeIgniter had a more secure and substantial user base
- Kohana does not have any unit testing (but it is coming in the next release)
- More add-ons (ignited code) for CodeIgniter adding any “missing” feature you can think of
My biggest complaint with CodeIgniter is the session handling. Session data is stored on the client side in a cookie. So you are limitted to 4kb of data. I prefer to store session data on the server side in a database. There are several add-ons for CodeIgniter that give you server side, database storage for session data.
If you have any questions about CodeIgniter, or comments about CodeIgniter vs Kohana, please feel free to share your thoughts!
4 Responses
To be perfectly honest, I’m not a big fan of this characterization of ZF (“Extreme Simplicity & Productivityâ€) and have been slowly replacing it on our site and elsewhere since I joined the project. Not that I don’t think it’s simple- it’s just that simplicity is not one of ZF’s strong points in a world of RoR and similar frameworks. We’re actually working up towards simplicity without trading off power; that is, we plan to have tooling without strict conventions (but with easy to use defaults), an integrated experience without compromising our use-at-will architecture, and simplified support for common use cases without skimping on extension points. In other words, IMO we’re challenging some of the tradeoffs that many people have take for granted in many frameworks. But there obviously *is* some tradeoff, or I’d imagine there would be many frameworks like this: development time. Quite simply, it’s going to take us a bit longer to get there.
Have you had a chance to check out 1.5? I hope our next release addresses many of your concerns; I can tell you the ‘first hour’ of the ZF experience has been dissected and we’re trying to improve it. Also, I’m glad to see that you realize the value of ZF as a set of components that may be used with other frameworks. That is precisely why it has been designed the way it has.
In any case, good luck no matter what framework you’re developing with!
,Wil
I have not developed a Zend Framework site with v1.5 for any of my clients. I have, however, read about the changes and was actively keep abreast of the upcoming advancements. The addition of partials, was once of the really exciting new features I was looking forward to in v1.5. The v1.0 and v1.1 versions felt really pre 1.0 to me and the 1.5 release seems like what should have been the 1.0 release. I’m not trying to belittle the work that has gone into the Zend Framework. There’s TONS of functionality that all seems to work really well. Thanks for the comment!
Great post Lee.
Things like the session handling limitation in CodeIgniter is precisely the reason why I made the difficult decision to write a PHP framework in-house and use it for our various projects.
The trouble is that the more I like into any framework (CakePHP, Symfony, CodeIgniter, etc), the more limitations I find. Sure, we can dig through the framework’s core code and make changes that will mold it our specific needs. But that is so unsatisfying. I fear that by the time we’re done "fixing" a framework, we’ll still have to show new employees which changes we have applied — to the point where we’d need to extend the documentation a bit. If we’re extending the code and extending the docs, we’re ultimately writing another framework by using the old one as a base.
If I were working on freelance projects that aren’t too complex, I’d definitely roll with one of these frameworks. The chances of me having to make some major changes are highly unlikely for simple projects. This is where I think these frameworks shine.
On the other hand, if I’m working with a team of people for 8 hours a day I don’t see any reason why we can’t write our basic framework and extend it based on our needs. I find that most of the code for a framework is actually writing the library, not the core features (core features being the MVC structure and loading some configs).
I’m sure many will disagree with me on this issue, but the benefits of working with familiar code fine tuned to your exact needs and your team’s coding style outweighs the risks.
So much time is spent pulling out hair writing CSS and JavaScript that works cross browser and dealing with IE bugs that the last thing I want is a team that has to pull out hair when trying to make something work in a 3rd party framework.
code igniter has a config option to allow you to save sessions in a database..