Foundations of PEAR: Rapid PHP Development (Foundations)


It’s great to see the number of PEAR books increasing recently, and this another one to add to your PEAR library. Foundations of PEAR, is the last new book for PEAR, a handy reference and recipe book for PEAR and its package, written by Nathan A. Good and Allan Kent and published by Apress. Certainly PEAR is huge in useful libraries, the same for this book with 610 pages and more than 50 packages. It scared me to finish it in the beginning, but the structure make it easier to read.
Packages covered in Foundations of PEAR are mostly PHP4 compatible, with the exception of PHPUnit2 which is PHP5 only. This is not strange because PHP4 usage remain much higher than PHP5 until today, and that’s of course the most popular and useful packages of PEAR.
The book start with an introduction to install PEAR and configure it, but didn’t mention go-pear.org which is very useful for a reference book in case for a reason or another the install didn’t work. Of course talking about the PEAR installer require a book itself, but you’ll find here the most useful information to find a package, install it, upgrade, working with channels. PEAR_Error is in the introduction too so you can get more familiar with errors handling and PEAR.


The overall organization of the packages in the book is almost the same, grouped by categories to make sense : Authentification, Utilities and tools, Dates and numbers, HTML, Images and Text, Database, File and Formats, HTTP, XML and finally Mail packages. For every package you’ll find the common uses, related packages, dependencies, API documentation and examples. Maybe it’s the API which making the book huge, but I think it should be there for a reference book. Examples are very well explained and give you the different possibilities to use the listed PEAR packages.
To finish the authors invite you to create real applications using PEAR packages, but it would be better if the packages used are all covered before in the book because you can find some packages used which are not there such HTML_AJAX. Otherwise applications are pretty interesting : an Intranet address book website, a Forum and a Web Calendar. So this give you an idea not only on PEAR packages but on how you can use them.
In conclusion the book is an excellent reference for PEAR packages, while I was missing many important categories such Web Services, Caching, Internationalization, Templating and validation but the covered packages are already great and very useful, maybe the authors limited the book for stable packages for possible API change in alpha ones. Otherwise if you are looking for a reference book about PEAR, this is the book to get.