diff options
author | Christian Dickmann <dickmann@php.net> | 2002-11-13 14:17:26 +0000 |
---|---|---|
committer | Christian Dickmann <dickmann@php.net> | 2002-11-13 14:17:26 +0000 |
commit | 18296252b2f86a3110d07405708617195608fbc4 (patch) | |
tree | c27b7826cd7380874f43defc66d6e2801ee64e6d /pear/PEAR | |
parent | 253cecd43aad193622daa237acf2bb173d99d68c (diff) | |
download | php-git-18296252b2f86a3110d07405708617195608fbc4.tar.gz |
Add new tag to package.xml named <warnings>.\nThis warnings are printed when installing/upgrading the package.\nThis patch was created in a cooperation with Tal Peer (Thanks for the idea Tal)
Diffstat (limited to 'pear/PEAR')
-rw-r--r-- | pear/PEAR/Command/Install.php | 8 | ||||
-rw-r--r-- | pear/PEAR/Common.php | 10 | ||||
-rw-r--r-- | pear/PEAR/Frontend/CLI.php | 14 |
3 files changed, 30 insertions, 2 deletions
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 <notes>".htmlspecialchars($pkginfo['release_notes'])."</notes>\n"; } + if (!empty($pkginfo['release_warnings'])) { + $ret .= "$indent <warnings>".htmlspecialchars($pkginfo['release_warnings'])."</warnings>\n"; + } if (isset($pkginfo['release_deps']) && sizeof($pkginfo['release_deps']) > 0) { $ret .= "$indent <deps>\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'])) |