PEAR_Info::packageInstalled() -- Check if a package is installed
Beschreibung
Simple function to check if a package is installed under user or system PEAR installation.
Minimal version and channel info are supported.
Parameter
- string $name
Package name
- string $version
(optional) The minimal version that should be installed
- string $channel
(optional) The package channel distribution
- string $user_file
(optional) file to read PEAR user-defined options from
- string $system_file
(optional) file to read PEAR system-wide defaults from
Seit
since
version 1.6.0 (2005-01-03)
Fehler-Meldungen
throws no exceptions thrown
Hinweise
Diese Methode sollte statisch
aufgerufen werden..
Beispiel
<?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";
}
?>
|