boolean PEAR_Info::packageInstalled (
string $name
, string $version
= null
, string $channel
= null
, string $user_file
= ''
, string $system_file
= ''
)
Simple function to check if a package is installed under user or system PEAR installation. Minimal version and channel info are supported.
$name
Package name
$version
(optional) The minimal version that should be installed
$channel
(optional) The package channel distribution
$user_file
(optional) file to read PEAR user-defined options from
$system_file
(optional) file to read PEAR system-wide defaults from
since version 1.6.0 (2005-01-03)
throws no exceptions thrown
This function should be called statically.
<?php
require_once 'PEAR/Info.php';
$res = PEAR_Info::packageInstalled('Role_Web', '1.1.0', 'pearified');
if ($res) {
print "Package pearified/Role_Web 1.1.0 or greater is installed \n";
} else {
print "Package pearified/Role_Web is not yet installed \n";
}
$res = PEAR_Info::packageInstalled('PEAR_PackageFileManager');
if ($res) {
print "Package pear/PEAR_PackageFileManager is installed \n";
} else {
print "Package pear/PEAR_PackageFileManager is not yet installed \n";
}
?>