]> granicus.if.org Git - php/commitdiff
Add new tag to package.xml named <warnings>.\nThis warnings are printed when installi...
authorChristian Dickmann <dickmann@php.net>
Wed, 13 Nov 2002 14:17:26 +0000 (14:17 +0000)
committerChristian Dickmann <dickmann@php.net>
Wed, 13 Nov 2002 14:17:26 +0000 (14:17 +0000)
pear/PEAR/Command/Install.php
pear/PEAR/Common.php
pear/PEAR/Frontend/CLI.php

index fd3ed39f247a2147cab32cc3565997a820fd60b7..69256a9f560ea1df315c489c68e3ef332f584bd8 100644 (file)
@@ -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
+?>
index 153b8e6f40e82715e5bd7e0f62553bf0a0a32f7a..af5ef9fc438c136203ca63029fc458ae44c2b3ea 100644 (file)
@@ -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) {
index 4c0802e5cf6192769ca12a94d917a513181c8d92..80a47507ca5d6fe1b90de24b6139506b503472da 100644 (file)
@@ -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']))