Re: cvs: pear-core /PEAR/Command Package.php
| From: | Greg Beaver | Date: | Sat, 29 Mar 2008 17:38:15 +0000 |
| Subject: | Re: cvs: pear-core /PEAR/Command Package.php | ||
| References: | 1 | Groups: | php.pear.cvs php.pear.core |
| Request: | Send a blank email to pear-core+get-7417@lists.php.net to get a copy of this message | ||
Helgi Þormar Þorbjörnsson wrote:
dufuz Fri Mar 28 22:53:31 2008 UTCThis is incorrect - the patch removes warning/error distinction. What you want is: if ($errors = $info->getValidationWarnings()) { } and then the original foreach() GregModified files: /pear-core/PEAR/Command Package.php Log:Bug #13525 pear package-validate is not showing warnings even if there are http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Command/Package.php?r1=1.126&r2=1.127&diff_format=u Index: pear-core/PEAR/Command/Package.php diff -u pear-core/PEAR/Command/Package.php:1.126 pear-core/PEAR/Command/Package.php:1.127 --- pear-core/PEAR/Command/Package.php:1.126 Tue Jan 29 03:21:01 2008 +++ pear-core/PEAR/Command/Package.php Fri Mar 28 22:53:31 2008 @@ -18,7 +18,7 @@* @author Greg Beaver <cellog@php.net>* @copyright 1997-2008 The PHP Group* @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Package.php,v 1.126 2008/01/29 03:21:01 cellog Exp $ + * @version CVS: $Id: Package.php,v 1.127 2008/03/28 22:53:31 dufuz Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1*/ @@ -374,15 +374,12 @@} else { $valid = $info->validate(PEAR_VALIDATE_PACKAGING); } - $err = array(); - $warn = array(); - if (!$valid) { - foreach ($info->getValidationWarnings() as $error) { - if ($error['level'] == 'warning') { - $warn[] = $error['message']; - } else { - $err[] = $error['message']; - } + $err = $warn = array(); + foreach ($info->getValidationWarnings() as $error) { + if (!$valid) { + $err[] = $error['message']; + } else { + $warn[] = $error['message'];