cvs: php4 /pear/PEAR/Command Registry.php

From: Date: Fri, 07 Jun 2002 08:45:01 +0000
Subject: cvs: php4 /pear/PEAR/Command Registry.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4471@lists.php.net to get a copy of this message
cox Fri Jun 7 04:45:01 2002 EDT Modified files: /php4/pear/PEAR/Command Registry.php Log: Make "info" full human friendly (in deps list and lastmodified) Index: php4/pear/PEAR/Command/Registry.php diff -u php4/pear/PEAR/Command/Registry.php:1.21 php4/pear/PEAR/Command/Registry.php:1.22 --- php4/pear/PEAR/Command/Registry.php:1.21 Fri Jun 7 03:54:28 2002 +++ php4/pear/PEAR/Command/Registry.php Fri Jun 7 04:45:00 2002 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.21 2002/06/07 07:54:28 cox Exp $ +// $Id: Registry.php,v 1.22 2002/06/07 08:45:00 cox Exp $ require_once 'PEAR/Command/Common.php'; require_once 'PEAR/Registry.php'; @@ -258,16 +258,27 @@ $i = 0; $dstr = ''; foreach ($info[$key] as $d) { - if ($i++ > 0) { - $dstr .= ", "; - } if (isset($this->_deps_rel_trans[$d['rel']])) { - $d['rel'] = $this->_deps_rel_trans[$d['rel']]; + $rel = $this->_deps_rel_trans[$d['rel']]; + } else { + $rel = $d['rel']; + } + + if (isset($this->_deps_type_trans[$d['type']])) { + $type = ucfirst($this->_deps_type_trans[$d['type']]); + } else { + $type = $d['type']; + } + + if (isset($d['name'])) { + $name = $d['name'] . ' '; } - $dstr .= "$d[type] $d[rel]"; if (isset($d['version'])) { - $dstr .= " $d[version]"; + $version = $d['version']; + } else { + $version = ''; } + $dstr .= "$type $name$rel $version\n"; } $info[$key] = $dstr; break; @@ -278,9 +289,15 @@ } } } - $info[$key] = trim($info[$key]); - if (in_array($key, $longtext)) { - $info[$key] = preg_replace('/ +/', ' ', $info[$key]); + if ($key == '_lastmodified') { + $hdate = date('Y-m-d', $info[$key]); + unset($info[$key]); + $info['Last Modified'] = $hdate; + } else { + $info[$key] = trim($info[$key]); + if (in_array($key, $longtext)) { + $info[$key] = preg_replace('/ +/', ' ', $info[$key]); + } } } $caption = 'About ' . $info['package'] . '-' . $info['version']; @@ -288,7 +305,7 @@ 'caption' => $caption, 'border' => true); foreach ($info as $key => $value) { - $key = ucwords(str_replace('_', ' ', $key)); + $key = ucwords(trim(str_replace('_', ' ', $key))); $data['data'][] = array($key, $value); }

« previous php.pear.cvs (#4471) next »