]> granicus.if.org Git - php/commitdiff
- Show the real dir where files would be installed (using role & config)
authorTomas V.V.Cox <cox@php.net>
Sat, 23 Mar 2002 17:27:39 +0000 (17:27 +0000)
committerTomas V.V.Cox <cox@php.net>
Sat, 23 Mar 2002 17:27:39 +0000 (17:27 +0000)
- Introduce column wrapping

pear/PEAR/Command/Package.php

index f6e07f6d66a65ab1bafaf72bf7da1fef649d763f..5ee224eae38a8d15bb4eccb125cb97f9baa35eed 100644 (file)
@@ -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;