FAQ – Answers to most Frequently Asked Questions


What does it cost ?

You can download and use it for free. But don't delete the copyright notice. You can read terms of the PHP license.

Do you offer support ?

YES if there is no answer in this Guide and if you are ready to share some informations such as : your configuration (platform Win *nix mac, PHP version, PEAR packages installed) and perharps your script.

I found a bug, what shall I do ?

You can report it with the bug tracker at PEAR.

What is PEAR ?

PEAR (an acronym for PHP Extension and Application Repository) is a framework and distribution system for reusable PHP components.

Don't forget to read also the PEAR Manual and PEAR FAQ.

I want to display my system configuration, but this one is not detected ?

If your system file (see command pear config-show) does not exists, or is locate in another directory, then you should give this information on PEAR_Info class constructor.

// @link http://pear.php.net/bugs/bug.php?id=12878
//       Search for pear.conf inside /etc/pear/

require_once 'PEAR/Info.php';

$pear_dir  '';
$user_file '';
$syst_file '/etc/pear/pear.conf';

$info = new PEAR_Info($pear_dir$user_file$syst_file);
I want to change the look an feel (colors) of PEAR_Info output ?

First copy the default stylesheet named pearinfo.css (locate in {data_dir}/PEAR_Info : see command pear config-show) as a pattern. Then second, change colors and whatever you want until you keep all CSS selectors.

See for example the blue layout pattern skin locate in package installation under name {doc_dir}/PEAR_Info/examples/blueskin.css.

Last, as {doc_dir}/PEAR_Info/examples/pear_info2.php script, set the new stylesheet with PEAR_Info::setStyleSheet.

require_once 'PEAR/Info.php';

$info = new PEAR_Info();
$info->setStyleSheet(dirname(__FILE__) . DIRECTORY_SEPARATOR 'blueskin.css');
I want to display packages from all my channels ?

By default PEAR_Info display only informations from pear.php.net channel.

To remove this limit, give as option to the class constructor an empty channels list, as below :

require_once 'PEAR/Info.php';

$pear_dir  '';
$user_file '';
$syst_file '/opt/lampp/etc/pear.conf';
$options   = array('channels' => array() );

$info = new PEAR_Info($pear_dir$user_file$syst_file$options);

If you want to filter package listing from a channel list, then give the full qualified list; something like :

= array('channels' => array('pear.php.net''pear.phpunit.de''__uri') );
I want to check if a package is installed or not ?

With static method PEAR_Info::packageInstalled, you can check installation of a package from all channels declared, and also filter by version.

require_once 'PEAR/Info.php';

$inst PEAR_Info::packageInstalled('Role_Web''1.1.0''pearified');
if (
$inst === false) {
'sorry it seems that "pearified/Role_Web" package is not installed'
' or version is less than 1.1.0';
About (Previous) What is New in version ? (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.