Display a quick list of package with only their version

Overview

The output may be customized by passing one or more of the PEAR_INFO_* constants bitwise values summed together in the optional 'resume' options parameter.

Screenshot

default green skin with channel list

...

default green skin with package version only

...

Dependencies

This example requires mandatory resources :

Explains step by step

Include the mandatory library at line 2, then instanciated a new PEAR_Info object at line 8, telling where to find the PEAR config file (second parameter), and a hash of options (fourth parameter), to filter PEAR information output. And finally display result at line 10.

resume key tell, with usage of PEAR_INFO_* constant, what information to display.

channels key tell what package information channel to display. Default is only, pear.php.net.

Source Code

PHP code
  1. <?php
  2. require_once 'PEAR/Info.php';
  3.  
  4. $options = array('resume' =>  PEAR_INFO_GENERAL | PEAR_INFO_CHANNELS | PEAR_INFO_PACKAGES_VERSION ,
  5.                  'channels' => array('pear.php.net', '__uri', 'pearified.com'));
  6.  
  7. $info = new PEAR_Info('', '', '', $options);
  8. $info->display();
  9. ?>
generated by Generic Syntax Highlighter - GeSHi