Re: [RFC2] Handling Backwards Compatibility in PEAR
| From: | Greg Beaver | Date: | Fri, 19 Sep 2003 22:11:07 +0000 |
| Subject: | Re: [RFC2] Handling Backwards Compatibility in PEAR | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-21815@lists.php.net to get a copy of this message | ||
Matthias Nothhaft wrote:
I guess this discussion is not at its end ;-) But, is there a way to determine in my script what packages and what versions are installed? Thanks and Regards, MatthiasYes, and this is possible with PEAR 1.2.1 - the current version. <?php require_once 'PEAR/Registry.php'; require_once 'PEAR/Config.php'; $config =& PEAR_Config::singleton(); $registry = new PEAR_Registry($config->get('php_dir')); var_dump($registry->listPackages()); $info = $registry->packageInfo('PEAR', 'release'); var_dump($info); ?> You may find that this doesn't work, if your environment can't find the PEAR installation. In that case, you have to replace the $config->get('php_dir') with a string containing the path to pear, perhaps found through a search of include_path for PEAR.php. Greg