I've seen three people ask a variation of how can I get a list of installed PEAR packages from within my PHP script
in the last few weeks on IRC, and two just in the last day. Because I'm a helpful sort, here's a little morsel of code that will do just that:
This should work with pretty much any version of PEAR.
(Update: Ken has a nifty bit of code in the comments to check for a specific installed version of a package.)
Copyright © 2006-10 Adam Harvey. Original content is licensed under a Creative Commons Attribution 2.5 Licence.