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

From: Date: Tue, 28 May 2002 01:21:53 +0000
Subject: cvs: php4 /pear/PEAR/Command Package.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4182@lists.php.net to get a copy of this message
ssb Mon May 27 21:21:53 2002 EDT Modified files: /php4/pear/PEAR/Command Package.php Log: * drop package-info command (deprecated by "info") Index: php4/pear/PEAR/Command/Package.php diff -u php4/pear/PEAR/Command/Package.php:1.32 php4/pear/PEAR/Command/Package.php:1.33 --- php4/pear/PEAR/Command/Package.php:1.32 Sun May 26 13:48:40 2002 +++ php4/pear/PEAR/Command/Package.php Mon May 27 21:21:47 2002 @@ -17,7 +17,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Package.php,v 1.32 2002/05/26 17:48:40 ssb Exp $ +// $Id: Package.php,v 1.33 2002/05/28 01:21:47 ssb Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Command/Common.php'; @@ -63,15 +63,6 @@ package.xml). ' ), - 'package-info' => array( - 'summary' => 'Display information about a package file', - 'function' => 'doPackageInfo', - 'shortcut' => 'pi', - 'options' => array(), - 'doc' => ' -Extracts information from a package file and displays it. -', - ), 'package-validate' => array( 'summary' => 'Validate Package Consistency', 'function' => 'doPackageValidate', @@ -188,82 +179,6 @@ if (PEAR::isError($result)) { $this->ui->displayLine("Package failed: ".$result->getMessage()); } - return true; - } - - function doPackageInfo($command, $options, $params) - { - // $params[0] -> the PEAR package to list its information - if (sizeof($params) != 1) { - return $this->raiseError("bad parameter(s), try \"help $command\""); - } - - $obj = new PEAR_Common(); - if (PEAR::isError($info = $obj->infoFromTgzFile($params[0]))) { - return $info; - } - unset($info['filelist']); - unset($info['changelog']); - $keys = array_keys($info); - $longtext = array('description', 'summary'); - foreach ($keys as $key) { - if (is_array($info[$key])) { - switch ($key) { - case 'maintainers': { - $i = 0; - $mstr = ''; - foreach ($info[$key] as $m) { - if ($i++ > 0) { - $mstr .= "\n"; - } - $mstr .= $m['name'] . " <"; - if (isset($m['email'])) { - $mstr .= $m['email']; - } else { - $mstr .= $m['handle'] . '@php.net'; - } - $mstr .= "> ($m[role])"; - } - $info[$key] = $mstr; - break; - } - case 'release_deps': { - $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']]; - } - $dstr .= "$d[type] $d[rel]"; - if (isset($d['version'])) { - $dstr .= " $d[version]"; - } - } - $info[$key] = $dstr; - break; - } - default: { - $info[$key] = implode(", ", $info[$key]); - break; - } - } - } - $info[$key] = trim($info[$key]); - if (in_array($key, $longtext)) { - $info[$key] = preg_replace('/ +/', ' ', $info[$key]); - } - } - $caption = 'About ' . basename($params[0]); - $this->ui->startTable(array('caption' => $caption, - 'border' => true)); - foreach ($info as $key => $value) { - $key = ucwords(str_replace('_', ' ', $key)); - $this->ui->tableRow(array($key, $value), null, array(1 => array('wrap' => 55))); - } - $this->ui->endTable(); return true; }

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