Question: How do I execute this command in PHP?
( Back )
Answer #1:
Yes, run that command in the cmd.exe in the directory that pear is installed, also here's a fun snippit of code =)include ‘PEAR/Registry.php’;
$reg = new PEAR_Registry;
$packages = array(array(“PEAR”, “1.6.2″),
array(“Date”, “1.4.7″),
array(“Date_Holidays”, “0.17.1″),
array(“Validate_IE”, “0.2.1″));
foreach($packages as $package) {
$pkg = $reg->getPackage($package[0]);
$version = $pkg->getVersion();
echo “{$package[0]} – {$package[1]} – “, version_compare($version, $package[1], “>=”) ? “OK”: “BAD”, “\n”;
}
Answer #2:
Do you have PEAR installed?Answer #3:
Yes. Change directory to the directory that contains your PEAR directory. So in DOS, it would look like this:C:\Program Files\wamp\bin\php\phpx.x.x>pear list
phpx.x.x. is the directory that contains your PEAR directory.
** Powered by Yahoo Answers