- Improve pear usage and PHP_Archive detection

This commit is contained in:
Marcus Boerger 2008-06-04 09:46:34 +00:00
parent 2ac1ba6254
commit 350824478b

View File

@ -209,13 +209,18 @@ class PharCommand extends CLICommand
{
if (($arg == '0' || $arg == '1') && !file_exists($arg)) {
$found = NULL;
foreach(split("\n", `pear list-files PHP_Archive`) as $ent) {
$matches = NULL;
if (preg_match(",^php[ \t]+([^ \t].*pear[\\\\/]PHP[\\\\/]Archive.php)$,", $ent, $matches)) {
$found = $matches[1];
break;
}
}
$apiver = `pear -q info PHP_Archive 2>/dev/null|grep 'API Version'`;
$apiver = trim(substr($apiver, strlen('API Version')));
if ($apiver) {
self::notice("Pear package PHP_Archive found: API Version: $apiver.\n");
foreach(split("\n", `pear list-files PHP_Archive`) as $ent) {
$matches = NULL;
if (preg_match(",^php[ \t]+([^ \t].*pear[\\\\/]PHP[\\\\/]Archive.php)$,", $ent, $matches)) {
$found = $matches[1];
break;
}
}
}
if (!isset($found)) {
$msg = "Pear package PHP_Archive or Archive.php class file not found.\n";
if ($arg == '0') {