cvs: pear-core /PEAR Validate.php

From: Date: Thu, 04 Nov 2004 04:40:20 +0000
Subject: cvs: pear-core /PEAR Validate.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-25663@lists.php.net to get a copy of this message
cellog Wed Nov 3 23:40:20 2004 EDT Modified files: /pear-core/PEAR Validate.php Log: fix validateStability() http://cvs.php.net/diff.php/pear-core/PEAR/Validate.php?r1=1.29&r2=1.30&ty=u Index: pear-core/PEAR/Validate.php diff -u pear-core/PEAR/Validate.php:1.29 pear-core/PEAR/Validate.php:1.30 --- pear-core/PEAR/Validate.php:1.29 Wed Nov 3 23:28:07 2004 +++ pear-core/PEAR/Validate.php Wed Nov 3 23:40:19 2004 @@ -16,7 +16,7 @@ // | Authors: Gregory Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Validate.php,v 1.29 2004/11/04 04:28:07 cellog Exp $ +// $Id: Validate.php,v 1.30 2004/11/04 04:40:19 cellog Exp $ define('PEAR_VALIDATE_INSTALLING', 1); define('PEAR_VALIDATE_UNINSTALLING', 2); // this is not bit-mapped like the others define('PEAR_VALIDATE_NORMAL', 3); @@ -488,15 +488,17 @@ $packagestability = $this->_packagexml->getState(); $apistability = $this->_packagexml->getState('api'); if (!PEAR_Validate::validState($packagestability)) { - $this->_addFailure('state', 'package stability "' . - $this->_packagexml->getState() . '" is not valid, must be one of: ' . + $this->_addFailure('state', 'invalid release stability "' . + $this->_packagexml->getState() . '", must be one of: ' . implode(', ', PEAR_Validate::getValidStates())); $ret = false; } - if (!PEAR_Validate::validState($apistability)) { - $this->_addFailure('state', 'API stability "' . - $this->_packagexml->getState() . '" is not valid, must be one of: ' . - implode(', ', PEAR_Validate::getValidStates())); + $apistates = PEAR_Validate::getValidStates(); + array_shift($apistates); // snapshot is not allowed + if (!in_array($apistability, $apistates)) { + $this->_addFailure('state', 'invalid API stability "' . + $this->_packagexml->getState('api') . '", must be one of: ' . + implode(', ', $apistates)); $ret = false; } return $ret;

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