Disclosure: After recently registering a Flickr account for this site, I happened across Rob Kunkle one of the co-authors of this book. He and the great people at Apress arranged for a copy of this to be delivered to my door. There was no cash crammed in the cover, so they need to work on their tactics a bit, but regardless they deserve a thank you for that. So thanks! After this review is complete, this book will be given as a door prize at the next DCPHP Developers' Group meeting. Now on with the review…
This book consists of nine chapters covering everything from working with the PHP/Flickr libraries to… installing Apache and just about everything in between.
The Good
The first couple chapters go through basic background and history of PHP and Flickr. I was familiar with the PHP side of things and have had the opportunity to meet about half of the people mentioned, but it was nonetheless interesting. The more interesting part was reading about how Flickr came about. We all know about Flickr since the Yahoo purchase, but this covered their history from day one.
The next meat of the book is in Chapters 5 through 9. They detail how and why to use the PHP/Flickr libraries appropriately named Phlickr. Rob and Andrew have done a great job with this. They start off with simply including a single image and build steadily from there. Before you know it, they're polling groups for new pictures, creating custom RSS feeds, and manipulating images in a multitude of ways. If you are considering using Phlickr on your own, this is a great resource.
My favorite example was a simple way of building and downloading your own custom portfolio based on a users' specific tags or even general search terms. Considering the sheer number and variety of pictures available, I think the standard clipart in Powerpoint can finally be replaced by more meaningful and interesting pictures. This is the code on how to get going and the ideas that you'll get from poking around with it are pretty nifty. Have fun.
The Bad
Chapter 4 bugged me. It was entitled “PHP Basics for Flickr” and therefore I expected a brief overview of the Phlickr libraries, how to use them, etc. Unfortunately, it was a 22 page summary on how to work with variables, arrays, etc. If this was a “Learn PHP in 24 hours” book, then this would make quite a bit of sense. Now go back and look at Chapter 3. It covered installing Apache, PHP, and the Phlickr library. Installing, configuring, and testing the library make up half the chapter and will be useful to just about everyone since you have to communicate with Flickr's API, etc.
That said, since this book is “intended for photographers, bloggers, and web designers”, then it makes quite a bit of sense to cover these topics. This allows the book to stand alone on the shelf and not cause someone to dig through php.net or Google to get the basics down. For anyone with even basic experience with PHP, these two chapters are going to feel like filler and 98% of those people will skip them.
The Ugly
Oh, the code. As far as I've played with, all of the code is 100% fully functional and works as expected. Unfortunately, there is nothing resembling security in most of the scripts. None of the data is being stored in a database, so that's not the issue. The bigger issue is that all inputs are passed along directly to the API and/or re-displayed on screen without any validation, scrubbing, etc. For scripts that run locally and won't be on the public internet, this isn't a huge issue. But when you're writing code for the uninitiated who are likely to upload this code to their website, it is dangerous to not cover security at all. It doesn't require a full tour of Essential PHP Security in order to be useful, but mentioning functions like is_numeric for a bit of validation would be a positive step forward. Or – at the very least – security concerns should be noted. As it stands, if my wife wanted to post any of these scripts to her site, I wouldn't let her.
The Summary
Overall, the Phlickr libraries are pretty neat and could be useful if you were interacting with them. the style of the book and the step-by-step construction of building up a useful application from little pieces is amazingly useful and gets your brain going with what you could do. If you are already an experienced PHP person, you'll pick the library and be up to speed in no time. For you, this book isn't going to be very useful. If you are – like my wife – an avid photographer, blogger, etc without the PHP skills but want to try it out, then pick it up and get moving.
I give this book an 9 for the target audience.
Further Resources: http://sourceforge.net/projects/phlickr/