Редакция 69 | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 69 | Редакция 87 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | /**
|
2 | /**
|
3 | * Channel Validator for the pecl.php.net channel
|
3 | * Channel Validator for the pecl.php.net channel
|
4 | *
|
4 | *
|
5 | * PHP 4 and PHP 5
|
5 | * PHP 4 and PHP 5
|
6 | *
|
6 | *
|
7 | * @category pear
|
7 | * @category pear
|
8 | * @package PEAR
|
8 | * @package PEAR
|
9 | * @author Greg Beaver <cellog@php.net>
|
9 | * @author Greg Beaver <cellog@php.net>
|
10 | * @copyright 1997-2006 The PHP Group
|
10 | * @copyright 1997-2006 The PHP Group
|
11 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
11 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
12 | * @version CVS: $Id: PECL.php,v 1.9 2008/01/03 20:26:37 cellog Exp $
|
12 | * @version CVS: $Id: PECL.php,v 1.9 2008/01/03 20:26:37 cellog Exp $
|
13 | * @link http://pear.php.net/package/PEAR
|
13 | * @link http://pear.php.net/package/PEAR
|
14 | * @since File available since Release 1.4.0a5
|
14 | * @since File available since Release 1.4.0a5
|
15 | */
|
15 | */
|
16 | /**
|
16 | /**
|
17 | * This is the parent class for all validators
|
17 | * This is the parent class for all validators
|
18 | */
|
18 | */
|
19 | require_once 'PEAR/Validate.php'; |
19 | require_once 'PEAR/Validate.php'; |
20 | /**
|
20 | /**
|
21 | * Channel Validator for the pecl.php.net channel
|
21 | * Channel Validator for the pecl.php.net channel
|
22 | * @category pear
|
22 | * @category pear
|
23 | * @package PEAR
|
23 | * @package PEAR
|
24 | * @author Greg Beaver <cellog@php.net>
|
24 | * @author Greg Beaver <cellog@php.net>
|
25 | * @copyright 1997-2008 The PHP Group
|
25 | * @copyright 1997-2008 The PHP Group
|
26 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
26 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
27 | * @version Release: 1.7.2
|
27 | * @version Release: 1.7.2
|
28 | * @link http://pear.php.net/package/PEAR
|
28 | * @link http://pear.php.net/package/PEAR
|
29 | * @since Class available since Release 1.4.0a5
|
29 | * @since Class available since Release 1.4.0a5
|
30 | */
|
30 | */
|
31 | class PEAR_Validator_PECL extends PEAR_Validate |
31 | class PEAR_Validator_PECL extends PEAR_Validate |
32 | {
|
32 | {
|
33 | function validateVersion() |
33 | function validateVersion() |
34 | {
|
34 | {
|
35 | if ($this->_state == PEAR_VALIDATE_PACKAGING) { |
35 | if ($this->_state == PEAR_VALIDATE_PACKAGING) { |
36 | $version = $this->_packagexml->getVersion(); |
36 | $version = $this->_packagexml->getVersion(); |
37 | $versioncomponents = explode('.', $version); |
37 | $versioncomponents = explode('.', $version); |
38 | $last = array_pop($versioncomponents); |
38 | $last = array_pop($versioncomponents); |
39 | if (substr($last, 1, 2) == 'rc') { |
39 | if (substr($last, 1, 2) == 'rc') { |
40 | $this->_addFailure('version', 'Release Candidate versions must have ' . |
40 | $this->_addFailure('version', 'Release Candidate versions must have ' . |
41 | 'upper-case RC, not lower-case rc'); |
41 | 'upper-case RC, not lower-case rc'); |
42 | return false; |
42 | return false; |
43 | }
|
43 | }
|
44 | }
|
44 | }
|
45 | return true; |
45 | return true; |
46 | }
|
46 | }
|
47 | 47 | ||
48 | function validatePackageName() |
48 | function validatePackageName() |
49 | {
|
49 | {
|
50 | $ret = parent::validatePackageName(); |
50 | $ret = parent::validatePackageName(); |
51 | if ($this->_packagexml->getPackageType() == 'extsrc' || |
51 | if ($this->_packagexml->getPackageType() == 'extsrc' || |
52 | $this->_packagexml->getPackageType() == 'zendextsrc') { |
52 | $this->_packagexml->getPackageType() == 'zendextsrc') { |
53 | if (strtolower($this->_packagexml->getPackage()) != |
53 | if (strtolower($this->_packagexml->getPackage()) != |
54 | strtolower($this->_packagexml->getProvidesExtension())) { |
54 | strtolower($this->_packagexml->getProvidesExtension())) { |
55 | $this->_addWarning('providesextension', 'package name "' . |
55 | $this->_addWarning('providesextension', 'package name "' . |
56 | $this->_packagexml->getPackage() . '" is different from extension name "' . |
56 | $this->_packagexml->getPackage() . '" is different from extension name "' . |
57 | $this->_packagexml->getProvidesExtension() . '"'); |
57 | $this->_packagexml->getProvidesExtension() . '"'); |
58 | }
|
58 | }
|
59 | }
|
59 | }
|
60 | return $ret; |
60 | return $ret; |
61 | }
|
61 | }
|
62 | }
|
62 | }
|
63 | ?>
|
63 | ?>
|