summaryrefslogtreecommitdiff
path: root/pear/PEAR/Command/Remote.php
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2002-04-28 07:35:30 +0000
committerStig Bakken <ssb@php.net>2002-04-28 07:35:30 +0000
commiteade67d6ab9de13de1cdc8f52c1b7912b7d3cf64 (patch)
treef19a0f18f995b7738e03dbce43786e540437731f /pear/PEAR/Command/Remote.php
parente08fb72a0c82c8fad829c175a9047769a1019cda (diff)
downloadphp-git-eade67d6ab9de13de1cdc8f52c1b7912b7d3cf64.tar.gz
* implemented "list-remote-packages" command
Diffstat (limited to 'pear/PEAR/Command/Remote.php')
-rw-r--r--pear/PEAR/Command/Remote.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/pear/PEAR/Command/Remote.php b/pear/PEAR/Command/Remote.php
index 87f73c3846..4014149a7f 100644
--- a/pear/PEAR/Command/Remote.php
+++ b/pear/PEAR/Command/Remote.php
@@ -86,6 +86,27 @@ class PEAR_Command_Remote extends PEAR_Command_Common
// {{{ 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;
}