diff options
| author | Stig Bakken <ssb@php.net> | 2002-04-28 07:35:30 +0000 |
|---|---|---|
| committer | Stig Bakken <ssb@php.net> | 2002-04-28 07:35:30 +0000 |
| commit | eade67d6ab9de13de1cdc8f52c1b7912b7d3cf64 (patch) | |
| tree | f19a0f18f995b7738e03dbce43786e540437731f | |
| parent | e08fb72a0c82c8fad829c175a9047769a1019cda (diff) | |
| download | php-git-eade67d6ab9de13de1cdc8f52c1b7912b7d3cf64.tar.gz | |
* implemented "list-remote-packages" command
| -rw-r--r-- | pear/PEAR/Command/Remote.php | 21 |
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; } |
