helly Wed Jun 4 09:46:34 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/phar/phar pharcommand.inc
Log:
- Improve pear usage and PHP_Archive detection
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar/pharcommand.inc?r1=1.49.2.6&r2=1.49.2.7&diff_format=u
Index: php-src/ext/phar/phar/pharcommand.inc
diff -u php-src/ext/phar/phar/pharcommand.inc:1.49.2.6
php-src/ext/phar/phar/pharcommand.inc:1.49.2.7
--- php-src/ext/phar/phar/pharcommand.inc:1.49.2.6 Mon Jun 2 13:39:54 2008
+++ php-src/ext/phar/phar/pharcommand.inc Wed Jun 4 09:46:34 2008
@@ -209,13 +209,18 @@
{
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') {
@@ -1534,7 +1539,7 @@
$use_ext = extension_loaded('phar');
$version = array(
'PHP Version' => phpversion(),
- 'phar.phar version' => '$Revision: 1.49.2.6 $',
+ 'phar.phar version' => '$Revision: 1.49.2.7 $',
'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