CodeIgniter 1.7 Professional Development 75
RickJWagner writes "CodeIgniter is a multi-purpose, open source PHP web application framework that can dramatically reduce the amount of coding required in developing a full-featured website. This book promises to introduce the reader to the most productive APIs and demonstrate their usage with minimal code snippets. In that regard, I think the book lives up to its promise." Read on for the rest of RickJWagner's review.
The first chapter covers CodeIgniter's MVC framework, which provides a way for a programmer to logically partition code so it's easier to maintain. For those of us who aren't accomplished PHP coders, this chapter also contains a PHP style guide, which I thought was a nice feature. By the way, the code snippets throughout the book are clean and easy to read -- the author must have followed his own advice on code style.CodeIgniter 1.7 professional development | |
author | Adam Griffith |
pages | 300 |
publisher | Packt Publishing |
rating | 9/10 |
reviewer | RickJWagner |
ISBN | 1849510903 |
summary | For advanced PHP developers who wish to use CodeIgniter to make their development easier, quicker, and more fun. |
The second chapter is an introduction to some of the more productive libraries you'll find in CodeIgniter. Here you'll find some excellent advice on how to take timing metrics in your application, how to secure it, and how to accomplish routine activities like retrieving data from the user's request. Other 'web topics' are addressed here, like how to manipulate the session, how to manage emails and file uploads, and much more.
Chapter 3 handles form inputs and databases. As is common throughout the book, the reader is given minimal technical overview. What you'll find instead is a very brief explanation of what's about to be covered, then a few very readable source lines that demonstrate use of CodeIgniter in action. If this book were your only resource, I'm sure there would be times where you didn't find enough material to get everything done you wanted to do. But if you have a web browser (and Google) handy, a book of this type can be an effective index to help you find the parts of a framework you want to leverage.
The next few chapters cover user authentication and application security. I found these to be a little spotty -- heavy in some places, light in others. Still, the material was useful and not difficult to read or understand.
A nice chapter on tips for building a large-scale application was next. I found this one interesting -- many of the ideas were well-known, but a few had not occurred to me before. I liked reading it. Next up was a chapter on Web Services. I didn't take the time to test the provided code for this chapter, but I would like to sometime. If it works as I hope it will, I may have a new way to stand-up test web services!
The final two chapters are on extending CodeIgniter (it's great that the library authors institutionalized this!) and donating code back to the community.
So who is this book for? The book itself tells you it's for expert PHP coders, but I don't believe that's exactly right. Given the easy-to-read nature of the book and the light treatment given to some of the meatier topics, I'd say this book is about right for a novice-to-intermediate-level PHP coder. I haven't done a lot in PHP, yet I found the code reading very easy.
If I had a wish for the book, I'd wish for a little more depth in the harder topics and maybe some quick overviews for a few topics. (Diagrams accompanying the overviews would be nice, too. This book has few illustrations except for screenshots.)
All things considered, I'd recommend this book to coders who are getting started with PHP and CodeIgniter. It's easy to read and will get the reader pointed in the right direction for solving many web problems.
You can purchase CodeIgniter 1.7 professional development from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
PHP frameworks (Score:1)
Re: (Score:2, Informative)
CodeIgniter has been around for a while, dude.
Re: (Score:1)
Re:PHP frameworks (Score:5, Informative)
umm, CodeIgniter is about 4 years old now. Perhaps they don't pop up every other week, you've just never heard of most of them since you're probably not a PHP developer.
Re: (Score:2)
Nah, not every other week, but every year it's a different framework that is the "Coolest thing ever and everyone who isn't using it is dumb" according to most of the PHP developers I know and work around. CI was their popular choice in 2007/2008. That was going to rock the web development world after the whole Ruby on Rails thing died down. 2008/2009 all I heard about was Drupal being the coolest framework ever. Before CI it was CakePHP. That was 2006/7ish. Before Cake, Zend was all the rage.
I was the
Snails? (Score:5, Funny)
The cover photo is of... snails?
Naturally, the immediate association is with "a snail's pace."
+1 for unintended consequence. Sigh.
Re:Snails? (Score:5, Funny)
Maybe it is snails because it leaves a sticky, messy trail wherever it goes? :p
j/k
Re: (Score:2)
PHP code? I don't know.
I'm so confused.
Re:Web application framework? (Score:5, Insightful)
You don't need to worry as much about security vulnerabilities
It's mantras like these that lead to so much insecure web code being written. You should always be equally worried about security no matter if you're using a framework or homegrown code.
Re: (Score:3, Insightful)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
less worried != more confident Ok. I will make sure to be more confident that my applications are secure, while still maintaining the same level of worry that they may be insecure.
Re: (Score:2)
As with any programming, you can still create security problems for yourself even using a popular framework.
That's like claiming there's fewer security errors in PHP websites than Zope sites because PHP is more popular.
In fact, popular rarely equates to secure.
Linux is more popular, OpenBSD is arguably more secure. Security often offends the sensibilities that would make a thing popular.
Re: (Score:1)
Re: (Score:2)
We are comparing a solid, mature framework, built and maintained by professionals, used on hundreds or thousands of sites, with a public bug reporting system to an ad hoc collection of code written by one person
Sounds like Linux vs OpenBSD to me!
Re: (Score:2)
Your incomplete understanding of my analogy does not invalidate it.
Re: (Score:2)
I don't really get why people use a framework for php at all. The whole point of php is so you can write web app code anyway you like. Writing to CI spec is such a waste of time since you literally have to track their APIs back to the source, and the functions defining these APIs are all over the place. Inject your own modules or applications into the existing session is hours of work just to track down what the hell they did. All the customer code are sitting in an include container, that handle sessions.
Re: (Score:2)
I beg to differ, there is no difference tracking down a piece of code in your mountain of framework definition and tracking down a piece of code in a mountain of procedural spaghetti code. In fact, it probably is easier to track down the procedural spaghetti code via grep than search recursively over 6 directories deep framework definition with the same code appear over and over again in 500+ different self inclusive source files. It doesn't matter how large your project is, as long as you maintain a sane c
Not so cut and dry (Score:2)
Frameworks trade the time needed to learn the framework for time writing your own code. The presumption that you will learn the framework as well as your own code is questionable at best. Odds are you won't need everything in the framework. The benefits of a wide community using the framework, and, if the framework is well maintained, having it tweaked as the community reports problems, is a big plus; but it is counter-featured by problems and vulnerabilities affecting wide swaths of users (until fixed or
another PHP framework... (Score:1)
open source PHP web application framework that can dramatically reduce the amount of coding required in developing a full-featured website
and dramatically increase the amount of unnecessarily executing code.
if your project doesn't function, how could you not have seen that without mocking it up? and if it does work, now you have to recode it completely to make it scalable. i never understand the lure of these development platforms on top of development platforms.
Re: (Score:2)
It's about not reinventing the wheel.
If that were true there wouldn't be the dozens upon dozens of frameworks that probably share little to no code between them. In fact, these frameworks are nothing but a constant reinventing of the wheel.
Re: (Score:1)
Re: (Score:1)
The point is, when you create your own framework YOU are reinventing the wheel. I would rather take advantage of solid code (since I use zend framework, I have no way of knowing if CI has solid code or not) written by someone else than to be spending my time writing code that is available freely, and is probably written better and more robust than I could manage, at least without many iterations of refactoring.
Re: (Score:2)
I'm not advocating everyone create their own framework (unless they really have a good use case for doing so) and thus you're arguing against a point I wasn't making.
Re: (Score:1)
Re: (Score:2)
Then again, i can think of several high-traffic sites using Django, but not of a single one using a PHP framework...
Re: (Score:1)
Re: (Score:2)
I'm aware - I'm not saying that using a framework is great idea for a highly scalable system, only that CI is probably the *least bad* of all the PHP frameworks.
And honestly, if you're that concerned about scalability, you're not going to be using PHP.
Re: (Score:1)
And honestly, if you're that concerned about scalability, you're not going to be using PHP.
I know that it isn't always the smoothest, but Facebook is PHP, and is pretty fricken huge.
Re: (Score:2)
Re: (Score:2)
I know that it isn't always the smoothest, but Facebook is PHP, and is pretty fricken huge.
Sort of. According to what an employee told me last week, lots of the core services are written in other languages, and then PHP is the glue that queries those services and builds the page itself. They then have found that that really isn't fast enough for what they want, so they've written their own compiler (Hip Hop [github.com]), which compiles PHP down to C++ which can then be compiled by G++.
So yeah, facebook uses it. But
Re: (Score:1)
Re: (Score:1)
Re: (Score:1)
PHP with the zend optimizer or any other compile/cache bytecode tools, has performance not worse than 10% of "pure" compiled servers doing the same tasks.
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
In my experience, the only decent PHP framework is Wordpress. Seriously, you can do a hell of a lot with very little work just by creating a theme and using three or four plugins. You can crank out an awesome, somewhat customized (feature-wise, I mean), client-editable site in a day, counting the graphics work, and 99% of the maintenance is just updating Wordpress when a bugfix or new version comes out. It's hard to beat that for smaller sites.
I've found that if I can't do it without any framework or wit
Love codeigniter but a book?? (Score:1)
Still supports PHP 4.3 (Score:2)
I am sorry, but the framework still supports PHP version 4.3.2. Support for PHP 4 was ended at the end of 2007. Any framework that doesn't take advantage of the nice new features in PHP 5 bound to be full of kludges and outdated code.
That is just my reaction based on when I was comparing PHP frameworks, I didn't dig into their code so maybe I am wrong.
Re: (Score:2)
I am sorry, but the framework still supports PHP version 4.3.2. Support for PHP 4 was ended at the end of 2007. Any framework that doesn't take advantage of the nice new features in PHP 5 bound to be full of kludges and outdated code.
That is just my reaction based on when I was comparing PHP frameworks, I didn't dig into their code so maybe I am wrong.
I haven't dug in too far, since I'm paid to spend my time working on my company's proprietary framework, but CodeIgniters seems to have done a pretty good job in how they've gone about maintaining PHP4 support. Clever solutions rather than outdated ones, to put it briefly. It also seems pretty easy to just use the parts of their code you need, and of course any code you write either within the framework or as a plugin can be 100% PHP5.
Re:Still supports PHP 4.3 (Score:4, Informative)
Re: (Score:2)
I believe CI 2.0 will break compatibility with the PHP 4 tree. Why is waiting until the next major revision to break compatibility a bad thing?
PHP 5 adoption is taking a long time, too. There are still webhosts that only offer 4.3.x. They suck, but they're out there.
Code Ignitor's fork KohanaPHP puts CI to shame (Score:5, Insightful)
Re:Code Ignitor's fork KohanaPHP puts CI to shame (Score:4, Informative)
Highly recommended for anyone out there looking for a PHP framework that actually makes sense.
Wish I had mod points. Kohana is the natural evolution of CI and made for PHP 5. It is much, much better than CI.
Re: (Score:2)
Kohana's documentation is giving me a server error. CI's major features is it's documentation. No thanks :)
Re: (Score:3, Interesting)
And your logic is flawless. We should totally disregard any product or entity with a website that ever goes down for any reason. I've got a lot of documentation for TI Extended BASIC. Maybe you'd like to switch over? To hell with the merits of
Re: (Score:2)
TI Extended Basic - you just flipped me into serious nostalgia mode.
Re: (Score:1)
OLD CS1
RUN
oh yeah
Re: (Score:2, Informative)
get last kohana from github, install the userguide, read docs.
you'll thank me later.
Re: (Score:1)
you're right 100%, using Kohana for few months now, won't replace it for anything (using CakePHP for almost 2 years)
and if we talk about shame, PHPStorm PHP IDE puts every other PHP IDE to shame.
Re: (Score:2, Interesting)
Viral Marketing (Score:1)
Re: (Score:1)
Then the Question Becomes (Score:2)