cvs: pear-core /PEAR/Command Registry.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Sat, 12 Jul 2008 14:47:42 +0000 |
| Subject: | cvs: pear-core /PEAR/Command Registry.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7641@lists.php.net to get a copy of this message | ||
dufuz Sat Jul 12 14:47:42 2008 UTC
Modified files:
/pear-core/PEAR/Command Registry.php
Log:
Request #12706 pear list -a hard to read
and a weee bit of cosmetics
http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Command/Registry.php?r1=1.83&r2=1.84&diff_format=u
Index: pear-core/PEAR/Command/Registry.php
diff -u pear-core/PEAR/Command/Registry.php:1.83 pear-core/PEAR/Command/Registry.php:1.84
--- pear-core/PEAR/Command/Registry.php:1.83 Tue Jun 24 19:02:27 2008
+++ pear-core/PEAR/Command/Registry.php Sat Jul 12 14:47:42 2008
@@ -16,7 +16,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2008 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Registry.php,v 1.83 2008/06/24 19:02:27 dufuz Exp $
+ * @version CVS: $Id: Registry.php,v 1.84 2008/07/12 14:47:42 dufuz Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -228,22 +228,27 @@
foreach ($installed as $channel => $packages) {
usort($packages, array($this, '_sortinfo'));
$data = array(
- 'caption' => 'Installed packages, channel ' . $channel .
':',
- 'border' => true,
+ 'caption' => 'Installed packages, channel ' . $channel .
':',
+ 'border' => true,
'headline' => array('Package', 'Version',
'State'),
- 'channel' => $channel
- );
+ 'channel' => $channel
+ );
+
foreach ($packages as $package) {
- $pobj = $reg->getPackage(isset($package['package']) ?
- $package['package'] :
$package['name'], $channel);
+ $p = isset($package['package']) ? $package['package'] :
$package['name'];
+ $pobj = $reg->getPackage($p, $channel);
$data['data'][] = array($pobj->getPackage(), $pobj->getVersion(),
$pobj->getState() ? $pobj->getState() : null);
}
- if (count($packages)==0) {
+
+ // Adds a blank line before each section
+ $data['data'][] = array();
+
+ if (count($packages) === 0) {
$data = array(
'caption' => 'Installed packages, channel ' . $channel .
':',
'border' => true,
- 'data' => array(array('(no packages installed)')),
+ 'data' => array(array('(no packages installed)'),
array()),
'channel' => $channel
);
}