3 * Channel Validator for the pecl.php.net channel
9 * @author Greg Beaver <cellog@php.net>
10 * @copyright 1997-2006 The PHP Group
11 * @license http://opensource.org/licenses/bsd-license.php New BSD License
12 * @link http://pear.php.net/package/PEAR
13 * @since File available since Release 1.4.0a5
16 * This is the parent class for all validators
18 require_once 'PEAR/Validate.php';
20 * Channel Validator for the pecl.php.net channel
23 * @author Greg Beaver <cellog@php.net>
24 * @copyright 1997-2009 The Authors
25 * @license http://opensource.org/licenses/bsd-license.php New BSD License
26 * @version Release: 1.10.1
27 * @link http://pear.php.net/package/PEAR
28 * @since Class available since Release 1.4.0a5
30 class PEAR_Validator_PECL extends PEAR_Validate
32 function validateVersion()
34 if ($this->_state == PEAR_VALIDATE_PACKAGING) {
35 $version = $this->_packagexml->getVersion();
36 $versioncomponents = explode('.', $version);
37 $last = array_pop($versioncomponents);
38 if (substr($last, 1, 2) == 'rc') {
39 $this->_addFailure('version', 'Release Candidate versions must have ' .
40 'upper-case RC, not lower-case rc');
47 function validatePackageName()
49 $ret = parent::validatePackageName();
50 if ($this->_packagexml->getPackageType() == 'extsrc' ||
51 $this->_packagexml->getPackageType() == 'zendextsrc') {
52 if (strtolower($this->_packagexml->getPackage()) !=
53 strtolower($this->_packagexml->getProvidesExtension())) {
54 $this->_addWarning('providesextension', 'package name "' .
55 $this->_packagexml->getPackage() . '" is different from extension name "' .
56 $this->_packagexml->getProvidesExtension() . '"');