helly Fri Aug 1 05:43:09 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/phar/phar pharcommand.inc
Log:
- Fix pear PHP_Archive class file location
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar/pharcommand.inc?r1=1.49.2.8&r2=1.49.2.9&diff_format=u
Index: php-src/ext/phar/phar/pharcommand.inc
diff -u php-src/ext/phar/phar/pharcommand.inc:1.49.2.8
php-src/ext/phar/phar/pharcommand.inc:1.49.2.9
--- php-src/ext/phar/phar/pharcommand.inc:1.49.2.8 Wed Jun 4 14:36:33 2008
+++ php-src/ext/phar/phar/pharcommand.inc Fri Aug 1 05:43:09 2008
@@ -209,19 +209,34 @@
{
if (($arg == '0' || $arg == '1') && !file_exists($arg)) {
$found = NULL;
- $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)) {
+ $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: API Version:
$apiver.\n");
+ $files = split("\n", `pear list-files PHP_Archive`);
+ $phpdir = `pear config-get php_dir 2>/dev/null`;
+ $phpdir = trim($phpdir);
+ self::notice("Pear package PHP_Archive: $phpdir.\n");
+ if (is_dir($phpdir)) {
+ foreach($files as $ent) {
+ $matches = NULL;
+ if (preg_match(",^php[ \t]+([^
\t].*[\\\\/]PHP[\\\\/]Archive\.php)$,", $ent, $matches)) {
+ $sub = $matches[1];
+ if (strpos($sub, $phpdir) !== 0) {
+ $found = NULL;
+ break;
+ }
+ $found = $sub;
+ break;
+ }
+ }
+ } else {
+ self::notice("Pear package PHP_Archive: corrupt or
inaccessible base dir: $php_dir.\n");
+ }
+ }
+ if (isset($found)) {
+ self::notice("Pear package PHP_Archive: $found.\n");
+ } else {
$msg = "Pear package PHP_Archive or Archive.php class file not
found.\n";
if ($arg == '0') {
self::notice($msg);
@@ -1539,7 +1554,7 @@
$use_ext = extension_loaded('phar');
$version = array(
'PHP Version' => phpversion(),
- 'phar.phar version' => '$Revision: 1.49.2.8 $',
+ 'phar.phar version' => '$Revision: 1.49.2.9 $',
'Phar EXT version' => $use_ext ? phpversion('phar') : 'Not
available',
'Phar API version' => Phar::apiVersion(),
'Phar-based phar archives' => true,
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php