summaryrefslogtreecommitdiff
path: root/pear
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2002-05-21 07:18:48 +0000
committerStig Bakken <ssb@php.net>2002-05-21 07:18:48 +0000
commitd8d42fcc592690ced67eef506c89a5a4e7e860eb (patch)
treeb79beefd84c554d8ddf10c29e0352e7ed04e1353 /pear
parent86a043d2505d2b1aab50f9f203367b448d7734ba (diff)
downloadphp-git-d8d42fcc592690ced67eef506c89a5a4e7e860eb.tar.gz
* show installed_as instead of a "calculated" path for installed packages
Diffstat (limited to 'pear')
-rw-r--r--pear/PEAR/Command/Registry.php68
1 files changed, 35 insertions, 33 deletions
diff --git a/pear/PEAR/Command/Registry.php b/pear/PEAR/Command/Registry.php
index 31859c0f75..37076da533 100644
--- a/pear/PEAR/Command/Registry.php
+++ b/pear/PEAR/Command/Registry.php
@@ -102,45 +102,47 @@ Tests if a package is installed in the system. Will exit(1) if it is not.
return $this->raiseError("`$params[0]' not installed");
}
$list = $info['filelist'];
- $caption = 'Contents of ' . basename($params[0]);
+ if ($installed) {
+ $caption = 'Installed Files For ' . $params[0];
+ } else {
+ $caption = 'Contents of ' . basename($params[0]);
+ }
$this->ui->startTable(array('caption' => $caption,
'border' => true));
$this->ui->tableRow($headings, array('bold' => true));
foreach ($list as $file => $att) {
- if (isset($att['baseinstalldir'])) {
- $dest = $att['baseinstalldir'] . DIRECTORY_SEPARATOR .
- $file;
- } else {
- $dest = $file;
- }
- switch ($att['role']) {
- case 'test':
- case 'data':
- if ($installed) {
- break 2;
- }
- $dest = '-- will not be installed --';
- break;
- case 'doc':
- $dest = $this->config->get('doc_dir') . DIRECTORY_SEPARATOR .
- $dest;
- break;
- case 'php':
- default:
- $dest = $this->config->get('php_dir') . DIRECTORY_SEPARATOR .
- $dest;
- }
- $dest = preg_replace('!/+!', '/', $dest);
- $file = preg_replace('!/+!', '/', $file);
-/*
- $opts = array(0 => array('wrap' => 23),
- 1 => array('wrap' => 45)
- );
-*/
if ($installed) {
- $this->ui->tableRow(array($att['role'], $dest), null, $opts);
+ if (empty($att['installed_as'])) {
+ continue;
+ }
+ $this->ui->tableRow(array($att['role'], $att['installed_as']));
} else {
- $this->ui->tableRow(array($file, $dest), null, $opts);
+ if (isset($att['baseinstalldir'])) {
+ $dest = $att['baseinstalldir'] . DIRECTORY_SEPARATOR .
+ $file;
+ } else {
+ $dest = $file;
+ }
+ switch ($att['role']) {
+ case 'test':
+ case 'data':
+ if ($installed) {
+ break 2;
+ }
+ $dest = '-- will not be installed --';
+ break;
+ case 'doc':
+ $dest = $this->config->get('doc_dir') . DIRECTORY_SEPARATOR .
+ $dest;
+ break;
+ case 'php':
+ default:
+ $dest = $this->config->get('php_dir') . DIRECTORY_SEPARATOR .
+ $dest;
+ }
+ $dest = preg_replace('!/+!', '/', $dest);
+ $file = preg_replace('!/+!', '/', $file);
+ $this->ui->tableRow(array($file, $dest));
}
}
$this->ui->endTable();