value * * @param array list of additional parameters * * @return bool TRUE on success, FALSE if the command was unknown, * or a PEAR error on failure * * @access public */ function run($command, $options, $params) { $failmsg = ''; $cf = &PEAR_Config::singleton(); switch ($command) { case 'list-installed': { $reg = new PEAR_Registry($cf->get('php_dir')); $installed = $reg->packageInfo(); $i = $j = 0; $this->ui->startTable( array('caption' => 'Installed packages:', 'border' => true)); foreach ($installed as $package) { if ($i++ % 20 == 0) { $this->ui->tableRow(array('Package', 'Version', 'State'), array('bold' => true)); } $this->ui->tableRow(array($package['package'], $package['version'], $package['release_state'])); } $this->ui->endTable(); break; } default: { return false; } } if ($failmsg) { return $this->raiseError($failmsg); } return true; } // }}} } ?>