summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2002-03-23 17:27:39 +0000
committerTomas V.V.Cox <cox@php.net>2002-03-23 17:27:39 +0000
commit8ea91258407e3d439b1087fc74ea612d7deed69f (patch)
tree565994b766cd62e5e1b7c33985d440ec8ec678bb
parent4cab908a78c1a083ad2c6a0a47d9f006605fd45e (diff)
downloadphp-git-8ea91258407e3d439b1087fc74ea612d7deed69f.tar.gz
- Show the real dir where files would be installed (using role & config)
- Introduce column wrapping
-rw-r--r--pear/PEAR/Command/Package.php28
1 files changed, 23 insertions, 5 deletions
diff --git a/pear/PEAR/Command/Package.php b/pear/PEAR/Command/Package.php
index f6e07f6d66..5ee224eae3 100644
--- a/pear/PEAR/Command/Package.php
+++ b/pear/PEAR/Command/Package.php
@@ -83,16 +83,33 @@ class PEAR_Command_Package extends PEAR_Command_Common
$caption = 'Contents of ' . basename($params[0]);
$this->ui->startTable(array('caption' => $caption,
'border' => true));
- $this->ui->tableRow(array('Package File', 'Install Destination'),
+ $this->ui->tableRow(array('Package Files', 'Install Destination'),
array('bold' => true));
foreach ($list as $file => $att) {
if (isset($att['baseinstalldir'])) {
- $dest = $att['baseinstalldir'] . '/' . basename($file);
+ $dest = $att['baseinstalldir'] . DIRECTORY_SEPARATOR .
+ basename($file);
} else {
$dest = basename($file);
}
- $dest = preg_replace('!^/+!', '', $dest);
- $this->ui->tableRow(array($file, $dest));
+ switch ($att['role']) {
+ case 'test':
+ continue 2;
+ $dest = '-- will not be installed --';
+ case 'doc':
+ $dest = $this->config->get('doc_dir') . DIRECTORY_SEPARATOR .
+ $dest;
+ 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)
+ );
+ $this->ui->tableRow(array($file, $dest), null, $opts);
}
$this->ui->endTable();
break;
@@ -104,6 +121,7 @@ class PEAR_Command_Package extends PEAR_Command_Common
return $info;
}
unset($info['filelist']);
+ unset($info['changelog']);
$keys = array_keys($info);
$longtext = array('description', 'summary');
foreach ($keys as $key) {
@@ -167,7 +185,7 @@ class PEAR_Command_Package extends PEAR_Command_Common
$this->ui->startTable(array('caption' => $caption,
'border' => true));
foreach ($info as $key => $value) {
- $this->ui->tableRow(array($key, $value));
+ $this->ui->tableRow(array($key, $value), null, array(1 => array('wrap' => 55)));
}
$this->ui->endTable();
break;