POSTS

Book Review: The PEAR Installer Manifesto

Author's Note: This has been posted to Amazon, where I rated the book four star.

"Isn't PEAR just a bunch of packages you can install?" That's the question you'll receive most of the time if you ask a PHP developer if his software can be installed through the PEAR Installer. There's been a lot of work happening in PEAR that's culminated most recently in the PEAR elections and the announcement of Pyrus - PEAR 2. A major force behind all of these changes, including work on the PEAR Installer, is Greg Beaver. With this book, he can claim "he wrote the book on PEAR". Not that anyone could have disagreed with him before getting this book published. :-)

This past weekend I read through the PEAR Installer Manifesto. For anyone who's not familiar the PEAR installer and how it can be used in projects outside of PEAR, I would point them to this book. It's only six chapters long, but it walks through the ways to use the PEAR Installer to enhance your projects - large or small, open or closed source, free or pay. This book covers the basics of what the PEAR Installer is, how to use it to distribute your own packages, and explains how to deploy a website using the installer. The book closes out with the two chapters that make this book a must read to someone already familiar with the PEAR Installer, but not familiar with what it is capable of: a chapter on PEAR channels and one on embedding the PEAR installer.

A PEAR channel isn't a difficult thing to setup; there are blog posts aplenty on the topic. This chapter fill in the gaps in those posts answering the «why» to how things are done. I've setup my own channel before, but I hadn't investigated the internals to figure out exactly how everything ticked. Chapter 5 - Releasing to the World: PEAR Channels, fills in the gaps and gives you a thorough understanding of what makes a channel tick.

Chapter 6 - Embedding the PEAR Installer: Designing a Custom Plug-In System, discusses several methods of handling plug-in systems then demonstrates how to create one using the PEAR Installer as a base. This chapter really starts to show exactly how powerful the installer can be once you start to re-purpose it, making it more than the command line tool we all use to download and install code. Thinking of the possibilities this introduced, I actually got giddy. Yes, I know... I'm a geek.

This is a four star rating, so there were a few things that weren't exactly what I had hoped for. I hoped this would serve as a full reference to the installer. While this book takes you a lot of great jumping off points, it doesn't have the thoroughness I wanted. There are areas where the complexity of the code you're calling isn't covered in depth and you're left with a "this is all you'll need to know for this task" type comment. It took a visit to Greg's PEAR channel to fully understand how to package a custom file role. The book demonstrated the required PHP for the role and showed the custom XML, but didn't explicitly state that they were to be packaged together or how they were to be packaged. An appendix offering an in-depth overview of the code related to the installer would be a great addition to this book. With the recent news of Pyrus, that might be outdated before it could be ready though.

I would have liked to have seen a more in-depth comparison to competing methods of building/packaging software. Instead, the only alternative that is discussed at any length is "unzip and go". It would have been interesting to see the comparison of the PEAR Installer to a traditional build system - such as PHP's phing or Java's Ant — and to explore using the installer inside a phing/Ant environment and how they could compliment each other. For example, using phing to handle the build process, while using PEAR channels and the installer to handle distribution and installation.

This book is definitely worth the read for anyone interested in the PEAR Installer and understanding what it is capable of. The absence of a full reference to the installer code and no mention of viable alternatives to handle packaging are the only things that kept me from rating this book at 5 stars.