cvs: php4 /pear/PEAR/Command Package.php
| From: | Tomas V.V.Cox | Date: | Thu, 06 Jun 2002 07:22:23 +0000 |
| Subject: | cvs: php4 /pear/PEAR/Command Package.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4434@lists.php.net to get a copy of this message | ||
cox Thu Jun 6 03:22:23 2002 EDT
Modified files:
/php4/pear/PEAR/Command Package.php
Log:
Split the doPackageInfo() in doPackageInfo() and _infoForDisplaying()
(this last one can be statically called and is used also from
the "info" command)
Index: php4/pear/PEAR/Command/Package.php
diff -u php4/pear/PEAR/Command/Package.php:1.35 php4/pear/PEAR/Command/Package.php:1.36
--- php4/pear/PEAR/Command/Package.php:1.35 Thu Jun 6 02:35:12 2002
+++ php4/pear/PEAR/Command/Package.php Thu Jun 6 03:22:23 2002
@@ -17,7 +17,7 @@
// | Martin Jansen <mj@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Package.php,v 1.35 2002/06/06 06:35:12 cox Exp $
+// $Id: Package.php,v 1.36 2002/06/06 07:22:23 cox Exp $
require_once 'PEAR/Common.php';
require_once 'PEAR/Command/Common.php';
@@ -203,11 +203,19 @@
if (sizeof($params) != 1) {
return $this->raiseError("bad parameter(s), try \"help
$command\"");
}
-
$obj = new PEAR_Common();
if (PEAR::isError($info = $obj->infoFromTgzFile($params[0]))) {
return $info;
}
+ $data = &PEAR_Command_Package::_infoForDisplaying($info);
+ $this->ui->outputData($data, $command);
+ }
+
+ /**
+ * @static
+ */
+ function &_infoForDisplaying($info)
+ {
unset($info['filelist']);
unset($info['changelog']);
$keys = array_keys($info);
@@ -270,8 +278,7 @@
$key = ucwords(str_replace('_', ' ', $key));
$data['data'][] = array($key, $value);
}
- $this->ui->outputData($data, $command);
- return true;
+ return $data;
}
function doPackageValidate($command, $options, $params)