cvs: php4 /pear/PEAR/Command Remote.php
| From: | Stig Bakken | Date: | Sun, 28 Apr 2002 07:35:30 +0000 |
| Subject: | cvs: php4 /pear/PEAR/Command Remote.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3597@lists.php.net to get a copy of this message | ||
ssb Sun Apr 28 03:35:30 2002 EDT
Modified files:
/php4/pear/PEAR/Command Remote.php
Log:
* implemented "list-remote-packages" command
Index: php4/pear/PEAR/Command/Remote.php
diff -u php4/pear/PEAR/Command/Remote.php:1.5 php4/pear/PEAR/Command/Remote.php:1.6
--- php4/pear/PEAR/Command/Remote.php:1.5 Tue Apr 23 03:01:45 2002
+++ php4/pear/PEAR/Command/Remote.php Sun Apr 28 03:35:30 2002
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Remote.php,v 1.5 2002/04/23 07:01:45 ssb Exp $
+// $Id: Remote.php,v 1.6 2002/04/28 07:35:30 ssb Exp $
require_once 'PEAR/Command/Common.php';
require_once 'PEAR/Common.php';
@@ -86,6 +86,27 @@
// {{{ list-remote-packages
case 'list-remote-packages': {
+ $r = new PEAR_Remote($this->config);
+ $available = $r->call('package.listAll', true);
+ if (PEAR::isError($available)) {
+ return $this->raiseError($available);
+ }
+ $i = $j = 0;
+ $this->ui->startTable(
+ array('caption' => 'Available packages:',
+ 'border' => true));
+ foreach ($available as $name => $info) {
+ if ($i++ % 20 == 0) {
+ $this->ui->tableRow(
+ array('Package', 'Version'),
+ array('bold' => true));
+ }
+ $this->ui->tableRow(array($name, $info['stable']));
+ }
+ if ($i == 0) {
+ $this->ui->tableRow(array('(no packages installed yet)'));
+ }
+ $this->ui->endTable();
break;
}