From: Christian Dickmann Date: Wed, 13 Nov 2002 14:17:26 +0000 (+0000) Subject: Add new tag to package.xml named .\nThis warnings are printed when installi... X-Git-Tag: php-4.3.0RC1~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18296252b2f86a3110d07405708617195608fbc4;p=php Add new tag to package.xml named .\nThis warnings are printed when installing/upgrading the package.\nThis patch was created in a cooperation with Tal Peer (Thanks for the idea Tal) --- diff --git a/pear/PEAR/Command/Install.php b/pear/PEAR/Command/Install.php index fd3ed39f24..69256a9f56 100644 --- a/pear/PEAR/Command/Install.php +++ b/pear/PEAR/Command/Install.php @@ -246,7 +246,11 @@ specified at once. if (is_array($info)) { if ($this->config->get('verbose') > 0) { $label = "$info[package] $info[version]"; - $this->ui->outputData("$command ok: $label", $command); + $out = array('data' => "$command ok: $label"); + if (isset($info['release_warnings'])) { + $out['release_warnings'] = $info['release_warnings']; + } + $this->ui->outputData($out, $command); } } else { return $this->raiseError("$command failed"); @@ -277,4 +281,4 @@ specified at once. } -?> \ No newline at end of file +?> diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index 153b8e6f40..af5ef9fc43 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -546,6 +546,13 @@ class PEAR_Common extends PEAR $this->pkginfo['release_notes'] = $data; } break; + case 'warnings': + if ($this->in_changelog) { + $this->current_release['release_warnings'] = $data; + } else { + $this->pkginfo['release_warnings'] = $data; + } + break; case 'state': if ($this->in_changelog) { $this->current_release['release_state'] = $data; @@ -882,6 +889,9 @@ class PEAR_Common extends PEAR if (!empty($pkginfo['release_notes'])) { $ret .= "$indent ".htmlspecialchars($pkginfo['release_notes'])."\n"; } + if (!empty($pkginfo['release_warnings'])) { + $ret .= "$indent ".htmlspecialchars($pkginfo['release_warnings'])."\n"; + } if (isset($pkginfo['release_deps']) && sizeof($pkginfo['release_deps']) > 0) { $ret .= "$indent \n"; foreach ($pkginfo['release_deps'] as $dep) { diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php index 4c0802e5cf..80a47507ca 100644 --- a/pear/PEAR/Frontend/CLI.php +++ b/pear/PEAR/Frontend/CLI.php @@ -355,6 +355,20 @@ class PEAR_Frontend_CLI extends PEAR { switch ($command) { + case 'install': + case 'upgrade': + if (isset($data['release_warnings'])) { + $this->_displayLine(''); + $this->_startTable(array( + 'border' => true, + 'caption' => 'Release Warnings' + )); + $this->_tableRow(array($data['release_warnings']), null, array(1 => array('wrap' => 55))); + $this->_endTable(); + $this->_displayLine(''); + }; + $this->_displayLine($data['data']); + break; case 'search': $this->_startTable($data); if (isset($data['headline']) && is_array($data['headline']))