cvs: pear-core /PEAR/PackageFile v1.php

From: Date: Fri, 10 Sep 2004 20:32:32 +0000
Subject: cvs: pear-core /PEAR/PackageFile v1.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-23806@lists.php.net to get a copy of this message
cellog Fri Sep 10 16:32:32 2004 EDT Modified files: /pear-core/PEAR/PackageFile v1.php Log: duh - the only channel allowed in package.xml version 1.0 is pear, so instead set up the validator http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/v1.php?r1=1.3&r2=1.4&ty=u Index: pear-core/PEAR/PackageFile/v1.php diff -u pear-core/PEAR/PackageFile/v1.php:1.3 pear-core/PEAR/PackageFile/v1.php:1.4 --- pear-core/PEAR/PackageFile/v1.php:1.3 Fri Sep 10 16:21:42 2004 +++ pear-core/PEAR/PackageFile/v1.php Fri Sep 10 16:32:26 2004 @@ -643,41 +643,6 @@ { $this->_isValid = true; $info = $this->_packageInfo; - $channel = isset($info['channel']) ? $info['channel'] : 'pear'; - $chan = isset($this->_registry) ? $this->_registry->getChannel($channel) : false; - if (!$chan) { - if ($channel != 'pear') { - $this->_validateError(PEAR_PACKAGEFILE_ERROR_UNKNOWN_CHANNEL, - array('channel' => $channel)); - } - if (!isset($info['package'])) { - $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_NAME); - } elseif (!PEAR_Common::validPackageName($info['package'])) { - $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_NAME, - array('name' => $info['package'])); - } - if (isset($info['extends'])) { - if (!PEAR_Common::validPackageName($info['extends'])) { - $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_EXTENDS, - array('extends' => $info['extends'])); - } - } - } else { - if (!empty($info['package'])) { - if (!$chan->validPackageName($info['package'])) { - $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_NAME, - array('name' => $info['package'])); - } - } else { - $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_NAME); - } - if (isset($info['extends'])) { - if (!$chan->validPackageName($info['extends'])) { - $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_EXTENDS, - array('extends' => $info['extends'])); - } - } - } $this->_packageName = $pn = $info['package']; if (empty($info['summary'])) { @@ -844,6 +809,12 @@ array('file' => $file, 'role' => $fa['role'], 'roles' => PEAR_Common::getFileRoles())); } } + } + if (isset($this->_registry)) { + $chan = $this->_registry->getChannel('pear'); + $validator = $chan->getValidationObject(); + $validator->setPackageFile($this); + $this->_isValid &= $validator->validate(); } return $this->_isValid; }

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