cvs: pear-core / .cvsignore package-PEAR.xml package2.xml /PEAR ChannelFile.php Common.php Config.php Downloader.php Registry.php Remote.php
/PEAR/Command Auth.php Channels.php Install.php Mirror.php Package.php Remote.php /PEAR/PackageFile v1.php /PEAR/PackageFile/v2 Validator.php
/PEAR/Task Replace.php /tests/PEAR_Command_Channels/channel-discover test_fail.phpt
| From: | Greg Beaver | Date: | Thu, 02 Mar 2006 18:14:13 +0000 |
| Subject: | cvs: pear-core / .cvsignore package-PEAR.xml package2.xml /PEAR ChannelFile.php Common.php Config.php Downloader.php Registry.php Remote.php /PEAR/Command Auth.php Channels.php Install.php Mirror.php Package.php Remote.php /PEAR/PackageFile v1.php /PEAR/PackageFile/v2 Validator.php /PEAR/Task Replace.php /tests/PEAR_Command_Channels/channel-discover test_fail.phpt |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38865@lists.php.net to get a copy of this message | ||
cellog Thu Mar 2 18:14:13 2006 UTC
Modified files:
/pear-core .cvsignore package-PEAR.xml package2.xml
/pear-core/PEAR ChannelFile.php Common.php Config.php
Downloader.php Registry.php Remote.php
/pear-core/PEAR/Command Auth.php Channels.php Install.php
Mirror.php Package.php Remote.php
/pear-core/PEAR/PackageFile v1.php
/pear-core/PEAR/PackageFile/v2 Validator.php
/pear-core/PEAR/Task Replace.php
/pear-core/tests/PEAR_Command_Channels/channel-discover
test_fail.phpt
Log:
prepare for
CRITICAL BUGFIX RELEASE
Channels with "-" in their name were suddenly invalid, and
caused crashes in many places due to improper error handling
* fix Bug #6960: channels are not allowed to have "-" in their name
* fix critical Bug #6969: PEAR list-upgrades crashes
* fix Bug #6991: Class 'PEAR_PackageFile_v1' not found in Registry.php at line 1657
http://cvs.php.net/viewcvs.cgi/pear-core/.cvsignore?r1=1.9&r2=1.10&diff_format=u Index: pear-core/.cvsignore diff -u pear-core/.cvsignore:1.9 pear-core/.cvsignore:1.10 --- pear-core/.cvsignore:1.9 Mon Apr 28 07:30:51 2003 +++ pear-core/.cvsignore Thu Mar 2 18:14:12 2006 @@ -4,3 +4,5 @@ run-tests php-config test.php +*.tgz +*.tar \ No newline at end of file http://cvs.php.net/viewcvs.cgi/pear-core/package-PEAR.xml?r1=1.348&r2=1.349&diff_format=u Index: pear-core/package-PEAR.xml diff -u pear-core/package-PEAR.xml:1.348 pear-core/package-PEAR.xml:1.349 --- pear-core/package-PEAR.xml:1.348 Tue Feb 21 01:18:21 2006 +++ pear-core/package-PEAR.xml Thu Mar 2 18:14:12 2006 @@ -78,38 +78,18 @@ </maintainer> </maintainers> <release> - <version>1.4.7</version> - <date>2006-02-27</date> + <version>1.4.8</version> + <date>2006-03-06</date> <license>PHP License</license> <state>stable</state> <notes> - Minor bugfix release - * Prevent packaging of release candidate releases with versions like 1.0.0rc1 - version_compare() only understands upper-case 1.0.0RC1 - * implement CLEAN section in .phpt tests - * implement run-tests command for phpunit-based tests - * implement Request #6039: setFrontendObject needed to allow objects passed - * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM - * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel - * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference - * fix Bug #6273: pear download-all fails - * fix Bug #6383: incomplete PEAR::Error message on addReplacement() - * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls - * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] - * fix Bug #6510: status active of a maintainer cannot be change - * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit - * fix Bug #6559: pear should ignore safemode/open_basedir - * fix Bug #6576: PFM2 run in trouble with sessions - * fix Bug #6579: PFM2 changelog and license with uri - * fix Bug #6673: pear install --offline --packagingroot=/blah does not work - * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration - * fix Bug #6675: postinstallscript validation fails - * fix Bug #6690: channel with / will not allow upgrade - * fix Bug #6692: Optional feature install message needs channel name - * fix Bug #6716: "pear install -r" errors after install when - attempting "pear list <pkgname>" - * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml - not in root dir + CRITICAL BUGFIX RELEASE + + Channels with "-" in their name were suddenly invalid, and + caused crashes in many places due to improper error handling + * fix Bug #6960: channels are not allowed to have "-" in their name + * fix critical Bug #6969: PEAR list-upgrades crashes + * fix Bug #6991: Class 'PEAR_PackageFile_v1' not found in Registry.php at line 1657 </notes> <provides type="class" name="OS_Guess"/> <provides type="class" name="System"/> @@ -622,5 +602,40 @@ * fix Request #6119: Add PEAR_Frontend_Gtk2 support to PEAR </notes> </release> + <release> + <version>1.4.7</version> + <date>2006-02-27</date> + <license>PHP License</license> + <state>stable</state> + <notes> + Minor bugfix release + * Prevent packaging of release candidate releases with versions like 1.0.0rc1 + version_compare() only understands upper-case 1.0.0RC1 + * implement CLEAN section in .phpt tests + * implement run-tests command for phpunit-based tests + * implement Request #6039: setFrontendObject needed to allow objects passed + * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM + * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel + * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference + * fix Bug #6273: pear download-all fails + * fix Bug #6383: incomplete PEAR::Error message on addReplacement() + * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls + * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] + * fix Bug #6510: status active of a maintainer cannot be change + * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit + * fix Bug #6559: pear should ignore safemode/open_basedir + * fix Bug #6576: PFM2 run in trouble with sessions + * fix Bug #6579: PFM2 changelog and license with uri + * fix Bug #6673: pear install --offline --packagingroot=/blah does not work + * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration + * fix Bug #6675: postinstallscript validation fails + * fix Bug #6690: channel with / will not allow upgrade + * fix Bug #6692: Optional feature install message needs channel name + * fix Bug #6716: "pear install -r" errors after install when + attempting "pear list <pkgname>" + * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml + not in root dir + </notes> + </release> </changelog> </package> http://cvs.php.net/viewcvs.cgi/pear-core/package2.xml?r1=1.242&r2=1.243&diff_format=u Index: pear-core/package2.xml diff -u pear-core/package2.xml:1.242 pear-core/package2.xml:1.243 --- pear-core/package2.xml:1.242 Tue Feb 21 01:18:21 2006 +++ pear-core/package2.xml Thu Mar 2 18:14:12 2006 @@ -77,10 +77,10 @@ <email>mj@php.net</email> <active>no</active> </helper> - <date>2006-02-27</date> + <date>2006-03-06</date> <version> - <release>1.4.7</release> - <api>1.4.1</api> + <release>1.4.8</release> + <api>1.4.2</api> </version> <stability> <release>stable</release> @@ -88,33 +88,13 @@ </stability> <license uri="http://www.php.net/license">PHP License</license> <notes> - Minor bugfix release - * Prevent packaging of release candidate releases with versions like 1.0.0rc1 - version_compare() only understands upper-case 1.0.0RC1 - * implement CLEAN section in .phpt tests - * implement run-tests command for phpunit-based tests - * implement Request #6039: setFrontendObject needed to allow objects passed - * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM - * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel - * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference - * fix Bug #6273: pear download-all fails - * fix Bug #6383: incomplete PEAR::Error message on addReplacement() - * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls - * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] - * fix Bug #6510: status active of a maintainer cannot be change - * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit - * fix Bug #6559: pear should ignore safemode/open_basedir - * fix Bug #6576: PFM2 run in trouble with sessions - * fix Bug #6579: PFM2 changelog and license with uri - * fix Bug #6673: pear install --offline --packagingroot=/blah does not work - * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration - * fix Bug #6675: postinstallscript validation fails - * fix Bug #6690: channel with / will not allow upgrade - * fix Bug #6692: Optional feature install message needs channel name - * fix Bug #6716: "pear install -r" errors after install when - attempting "pear list <pkgname>" - * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml - not in root dir + CRITICAL BUGFIX RELEASE + + Channels with "-" in their name were suddenly invalid, and + caused crashes in many places due to improper error handling + * fix Bug #6960: channels are not allowed to have "-" in their name + * fix critical Bug #6969: PEAR list-upgrades crashes + * fix Bug #6991: Class 'PEAR_PackageFile_v1' not found in Registry.php at line 1657 </notes> <contents> <dir name="/"> @@ -769,5 +749,46 @@ * fix Request #6119: Add PEAR_Frontend_Gtk2 support to PEAR </notes> </release> + <release> + <version> + <release>1.4.7</release> + <api>1.4.1</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <date>2006-02-27</date> + <license uri="http://www.php.net/license/3_0.txt">PHP License</license> + <notes> + Minor bugfix release + * Prevent packaging of release candidate releases with versions like 1.0.0rc1 + version_compare() only understands upper-case 1.0.0RC1 + * implement CLEAN section in .phpt tests + * implement run-tests command for phpunit-based tests + * implement Request #6039: setFrontendObject needed to allow objects passed + * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM + * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel + * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference + * fix Bug #6273: pear download-all fails + * fix Bug #6383: incomplete PEAR::Error message on addReplacement() + * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls + * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] + * fix Bug #6510: status active of a maintainer cannot be change + * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit + * fix Bug #6559: pear should ignore safemode/open_basedir + * fix Bug #6576: PFM2 run in trouble with sessions + * fix Bug #6579: PFM2 changelog and license with uri + * fix Bug #6673: pear install --offline --packagingroot=/blah does not work + * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration + * fix Bug #6675: postinstallscript validation fails + * fix Bug #6690: channel with / will not allow upgrade + * fix Bug #6692: Optional feature install message needs channel name + * fix Bug #6716: "pear install -r" errors after install when + attempting "pear list <pkgname>" + * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml + not in root dir + </notes> + </release> </changelog> </package> http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/ChannelFile.php?r1=1.74&r2=1.75&diff_format=u Index: pear-core/PEAR/ChannelFile.php diff -u pear-core/PEAR/ChannelFile.php:1.74 pear-core/PEAR/ChannelFile.php:1.75 --- pear-core/PEAR/ChannelFile.php:1.74 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/ChannelFile.php Thu Mar 2 18:14:12 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: ChannelFile.php,v 1.74 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: ChannelFile.php,v 1.75 2006/03/02 18:14:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -324,6 +324,20 @@ } return $a; } + + /** + * Unlike {@link fromArray()} this does not do any validation + * @param array + * @static + * @return PEAR_ChannelFile + */ + function &fromArrayWithErrors($data, $compatibility = false, + $stackClass = 'PEAR_ErrorStack') + { + $a = new PEAR_ChannelFile($compatibility, $stackClass); + $a->_fromArray($data); + return $a; + } /** * @param array http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Common.php?r1=1.154&r2=1.155&diff_format=u Index: pear-core/PEAR/Common.php diff -u pear-core/PEAR/Common.php:1.154 pear-core/PEAR/Common.php:1.155 --- pear-core/PEAR/Common.php:1.154 Sat Feb 4 05:01:55 2006 +++ pear-core/PEAR/Common.php Thu Mar 2 18:14:12 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Common.php,v 1.154 2006/02/04 05:01:55 cellog Exp $ + * @version CVS: $Id: Common.php,v 1.155 2006/03/02 18:14:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1.0 * @deprecated File deprecated since Release 1.4.0a1 @@ -51,7 +51,7 @@ define('PEAR_CHANNELS_NAME_PREG', '/^' . _PEAR_CHANNELS_NAME_PREG . '$/'); // this should allow any dns or IP address, plus a path - NO UNDERSCORES ALLOWED -define('_PEAR_CHANNELS_SERVER_PREG', '[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*(\/[a-zA-Z0-9]+)*'); +define('_PEAR_CHANNELS_SERVER_PREG', '[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*(\/[a-zA-Z0-9\-]+)*'); define('PEAR_CHANNELS_SERVER_PREG', '/^' . _PEAR_CHANNELS_SERVER_PREG . '$/i'); define('_PEAR_CHANNELS_PACKAGE_PREG', '(' ._PEAR_CHANNELS_SERVER_PREG . ')\/(' http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Config.php?r1=1.123&r2=1.124&diff_format=u Index: pear-core/PEAR/Config.php diff -u pear-core/PEAR/Config.php:1.123 pear-core/PEAR/Config.php:1.124 --- pear-core/PEAR/Config.php:1.123 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Config.php Thu Mar 2 18:14:12 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Config.php,v 1.123 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Config.php,v 1.124 2006/03/02 18:14:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -1265,6 +1265,9 @@ $reg = &$this->getRegistry(); if (is_object($reg)) { $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } if (!$chan->getMirror($test) && $chan->getName() != $test) { return $channel; // mirror does not exist } @@ -1286,6 +1289,9 @@ $reg = &$this->getRegistry(); if (is_object($reg)) { $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } if (!$chan->getMirror($test) && $chan->getName() != $test) { return $channel; // mirror does not exist } @@ -1329,6 +1335,9 @@ $reg = &$this->getRegistry($layer); if (is_object($reg)) { $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } if (!$chan->getMirror($ret) && $chan->getName() != $ret) { return $channel; // mirror does not exist } @@ -1383,6 +1392,9 @@ $reg = &$this->getRegistry($layer); if (is_object($reg)) { $chan = &$reg->getChannel($channel ? $channel : 'pear.php.net'); + if (PEAR::isError($chan)) { + return false; + } if (!$chan->getMirror($value) && $chan->getName() != $value) { return false; // mirror does not exist } http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Downloader.php?r1=1.98&r2=1.99&diff_format=u Index: pear-core/PEAR/Downloader.php diff -u pear-core/PEAR/Downloader.php:1.98 pear-core/PEAR/Downloader.php:1.99 --- pear-core/PEAR/Downloader.php:1.98 Thu Feb 2 17:16:51 2006 +++ pear-core/PEAR/Downloader.php Thu Mar 2 18:14:13 2006 @@ -18,7 +18,7 @@ * @author Martin Jansen <mj@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Downloader.php,v 1.98 2006/02/02 17:16:51 cellog Exp $ + * @version CVS: $Id: Downloader.php,v 1.99 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.0 */ @@ -301,6 +301,10 @@ require_once 'System.php'; } $curchannel = &$this->_registry->getChannel($params[$i]->getChannel()); + if (PEAR::isError($curchannel)) { + PEAR::staticPopErrorHandling(); + return $this->raiseError($curchannel); + } $a = $this->downloadHttp('http://' . $params[$i]->getChannel() . '/channel.xml', $this->ui, System::mktemp(array('-d')), null, $curchannel->lastModified()); @@ -719,6 +723,9 @@ } while (false); } $chan = &$this->_registry->getChannel($parr['channel']); + if (PEAR::isError($chan)) { + return $chan; + } $version = $this->_registry->packageInfo($parr['package'], 'version', $parr['channel']); if ($chan->supportsREST($this->config->get('preferred_mirror')) && @@ -857,6 +864,9 @@ unset($parr['state']); } $chan = &$this->_registry->getChannel($remotechannel); + if (PEAR::isError($chan)) { + return $chan; + } $version = $this->_registry->packageInfo($dep['name'], 'version', $remotechannel); if ($chan->supportsREST($this->config->get('preferred_mirror')) && @@ -964,6 +974,9 @@ $package = "http://pear.php.net/get/$package"; } else { $chan = $this->_registry->getChannel($channel); + if (PEAR::isError($chan)) { + return ''; + } $package = "http://" . $chan->getServer() . "/get/$package"; } if (!extension_loaded("zlib")) { http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Registry.php?r1=1.147&r2=1.148&diff_format=u Index: pear-core/PEAR/Registry.php diff -u pear-core/PEAR/Registry.php:1.147 pear-core/PEAR/Registry.php:1.148 --- pear-core/PEAR/Registry.php:1.147 Sat Feb 4 06:04:29 2006 +++ pear-core/PEAR/Registry.php Thu Mar 2 18:14:13 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Registry.php,v 1.147 2006/02/04 06:04:29 cellog Exp $ + * @version CVS: $Id: Registry.php,v 1.148 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -536,6 +536,9 @@ return false; } $channel = $this->_getChannel($channel); + if (PEAR::isError($channel)) { + return $channel; + } return $channel->getAlias(); } // }}} @@ -836,6 +839,9 @@ return false; } $checker = $this->_getChannel($channel->getName()); + if (PEAR::isError($channel)) { + return $channel; + } if ($channel->getAlias() != $checker->getAlias()) { @unlink($this->_getChannelAliasFileName($checker->getAlias())); } @@ -1288,7 +1294,7 @@ /** * @param string channel name * @param bool whether to strictly retrieve channel names - * @return PEAR_ChannelFile|false + * @return PEAR_ChannelFile|PEAR_Error * @access private */ function &_getChannel($channel, $noaliases = false) @@ -1298,9 +1304,9 @@ if (!class_exists('PEAR_ChannelFile')) { require_once 'PEAR/ChannelFile.php'; } - $ch = &PEAR_ChannelFile::fromArray($this->_channelInfo($channel, $noaliases)); + $ch = &PEAR_ChannelFile::fromArrayWithErrors($this->_channelInfo($channel, $noaliases)); } - if ($ch) { + if ($ch->validate()) { return $ch; } if ($this->_getChannelFromAlias($channel) == 'pear.php.net') { @@ -1343,6 +1349,10 @@ $private->setSummary('Pseudo-channel for static packages'); return $private; } + foreach ($ch->getErrors(true) as $err) { + $message = $err['message'] . "\n"; + } + $ch = PEAR::raiseError($message); return $ch; } @@ -1654,6 +1664,9 @@ $ret = $this->_updatePackage($package, $info, $merge); $this->_unlock(); if ($ret) { + if (!class_exists('PEAR_PackageFile_v1')) { + require_once 'PEAR/PackageFile/v1.php'; + } $pf = new PEAR_PackageFile_v1; $pf->setConfig($this->_config); $pf->fromArray($this->packageInfo($package)); @@ -1691,7 +1704,7 @@ /** * @param string channel name * @param bool whether to strictly return raw channels (no aliases) - * @return PEAR_ChannelFile|false + * @return PEAR_ChannelFile|PEAR_Error */ function &getChannel($channel, $noaliases = false) { @@ -1792,7 +1805,11 @@ return $e; } foreach ($this->_listChannels() as $channel) { - $ret[] = &$this->_getChannel($channel); + $e = &$this->_getChannel($channel); + if (PEAR::isError($e)) { + continue; + } + $ret[] = $e; } $this->_unlock(); return $ret; http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Remote.php?r1=1.75&r2=1.76&diff_format=u Index: pear-core/PEAR/Remote.php diff -u pear-core/PEAR/Remote.php:1.75 pear-core/PEAR/Remote.php:1.76 --- pear-core/PEAR/Remote.php:1.75 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Remote.php Thu Mar 2 18:14:13 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Remote.php,v 1.75 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Remote.php,v 1.76 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -151,7 +151,7 @@ $server_channel = $this->config->get('default_channel'); $channel = $this->_registry->getChannel($server_channel); - if ($channel) { + if (!PEAR::isError($channel)) { $mirror = $this->config->get('preferred_mirror'); if ($channel->getMirror($mirror)) { if ($channel->supports('xmlrpc', $method, $mirror)) { @@ -277,7 +277,7 @@ } while (false); $server_channel = $this->config->get('default_channel'); $channel = $this->_registry->getChannel($server_channel); - if ($channel) { + if (!PEAR::isError($channel)) { $mirror = $this->config->get('preferred_mirror'); if ($channel->getMirror($mirror)) { if ($channel->supports('xmlrpc', $method, $mirror)) { http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Auth.php?r1=1.22&r2=1.23&diff_format=u Index: pear-core/PEAR/Command/Auth.php diff -u pear-core/PEAR/Command/Auth.php:1.22 pear-core/PEAR/Command/Auth.php:1.23 --- pear-core/PEAR/Command/Auth.php:1.22 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Command/Auth.php Thu Mar 2 18:14:13 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Auth.php,v 1.22 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Auth.php,v 1.23 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -108,6 +108,9 @@ $reg = &$this->config->getRegistry(); $channel = $this->config->get('default_channel'); $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $server = $this->config->get('preferred_mirror'); $remote = &$this->config->getRemote(); $username = $this->config->get('username'); @@ -166,6 +169,9 @@ $reg = &$this->config->getRegistry(); $channel = $this->config->get('default_channel'); $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $server = $this->config->get('preferred_mirror'); $this->ui->outputData("Logging out from $server.", $command); $this->config->remove('username'); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Channels.php?r1=1.43&r2=1.44&diff_format=u Index: pear-core/PEAR/Command/Channels.php diff -u pear-core/PEAR/Command/Channels.php:1.43 pear-core/PEAR/Command/Channels.php:1.44 --- pear-core/PEAR/Command/Channels.php:1.43 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Command/Channels.php Thu Mar 2 18:14:13 2006 @@ -18,7 +18,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Channels.php,v 1.43 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Channels.php,v 1.44 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -218,7 +218,7 @@ if ($reg->channelExists($channel, true)) { $this->ui->outputData("Updating channel \"$channel\"", $command); $test = $reg->getChannel($channel, true); - if (!$test) { + if (PEAR::isError($test)) { $this->ui->outputData("Channel '$channel' is corrupt in registry!", $command); $lastmodified = false; } else { @@ -266,6 +266,9 @@ } else { if ($reg->isAlias($channel)) { $temp = &$reg->getChannel($channel); + if (PEAR::isError($temp)) { + return $this->raiseError($temp); + } $temp->setAlias($temp->getName(), true); // set the alias to the channel name if ($reg->channelExists($temp->getName())) { $this->ui->outputData('ERROR: existing channel "' . $temp->getName() . @@ -323,6 +326,9 @@ $channel = strtolower($params[0]); if ($reg->channelExists($channel)) { $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } } else { if (strpos($channel, '://')) { $downloader = &$this->getDownloader(); @@ -600,6 +606,9 @@ if ((!file_exists($params[0]) || is_dir($params[0])) && $reg->channelExists(strtolower($params[0]))) { $c = $reg->getChannel(strtolower($params[0])); + if (PEAR::isError($c)) { + return $this->raiseError($c); + } $this->ui->outputData('Retrieving channel.xml from remote server'); $dl = &$this->getDownloader(array()); // if force is specified, use a timestamp of "1" to force retrieval @@ -729,9 +738,9 @@ 'already aliased to "' . strtolower($params[1]) . '", cannot re-alias'); } $chan = &$reg->getChannel($params[0]); - if (!$chan) { + if (PEAR::isError($chan)) { return $this->raiseError('Corrupt registry? Error retrieving channel "' . $params[0] . - '" information'); + '" information (' . $chan->getMessage() . ')'); } // make it a local alias if (!$chan->setAlias(strtolower($params[1]), true)) { @@ -762,7 +771,8 @@ $err = $this->doAdd($command, $options, array('http://' . $params[0] . '/channel.xml')); $this->popErrorHandling(); if (PEAR::isError($err)) { - return $this->raiseError("Discovery of channel \"$params[0]\" failed"); + return $this->raiseError("Discovery of channel \"$params[0]\" failed (" . + $err->getMessage() . ')'); } $this->ui->outputData("Discovery of channel \"$params[0]\" succeeded", $command); } http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Install.php?r1=1.114&r2=1.115&diff_format=u Index: pear-core/PEAR/Command/Install.php diff -u pear-core/PEAR/Command/Install.php:1.114 pear-core/PEAR/Command/Install.php:1.115 --- pear-core/PEAR/Command/Install.php:1.114 Mon Feb 6 00:36:27 2006 +++ pear-core/PEAR/Command/Install.php Thu Mar 2 18:14:13 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Install.php,v 1.114 2006/02/06 00:36:27 cellog Exp $ + * @version CVS: $Id: Install.php,v 1.115 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -371,6 +371,9 @@ } $this->config->set('default_channel', $channel); $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $dorest = true; http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Mirror.php?r1=1.17&r2=1.18&diff_format=u Index: pear-core/PEAR/Command/Mirror.php diff -u pear-core/PEAR/Command/Mirror.php:1.17 pear-core/PEAR/Command/Mirror.php:1.18 --- pear-core/PEAR/Command/Mirror.php:1.17 Mon Jan 23 19:05:52 2006 +++ pear-core/PEAR/Command/Mirror.php Thu Mar 2 18:14:13 2006 @@ -15,7 +15,7 @@ * @author Alexander Merz <alexmerz@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Mirror.php,v 1.17 2006/01/23 19:05:52 cellog Exp $ + * @version CVS: $Id: Mirror.php,v 1.18 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.2.0 */ @@ -113,6 +113,9 @@ $this->config->set('default_channel', $channel); $this->ui->outputData('Using Channel ' . $this->config->get('default_channel')); $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Package.php?r1=1.118&r2=1.119&diff_format=u Index: pear-core/PEAR/Command/Package.php diff -u pear-core/PEAR/Command/Package.php:1.118 pear-core/PEAR/Command/Package.php:1.119 --- pear-core/PEAR/Command/Package.php:1.118 Tue Feb 21 00:59:13 2006 +++ pear-core/PEAR/Command/Package.php Thu Mar 2 18:14:13 2006 @@ -18,7 +18,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Package.php,v 1.118 2006/02/21 00:59:13 cellog Exp $ + * @version CVS: $Id: Package.php,v 1.119 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -823,6 +823,9 @@ $alias = 'PEAR'; } else { $chan = &$reg->getChannel($pf->getChannel()); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $alias = $chan->getAlias(); $alias = strtoupper($alias); $info['possible_channel'] = $pf->getChannel() . '/'; @@ -892,6 +895,9 @@ foreach ($cfg as $k) { if ($k == 'master_server') { $chan = $reg->getChannel($pf->getChannel()); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $info[$k] = $chan->getServer(); continue; } @@ -918,6 +924,9 @@ if (isset($dep['channel']) && $dep['channel'] != 'pear.php.net' && $dep['channel'] != 'pecl.php.net') { $chan = &$reg->getChannel($dep['channel']); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $package = strtoupper($chan->getAlias()) . '::' . $dep['name']; } else { $package = 'PEAR::' . $dep['name']; @@ -961,6 +970,9 @@ foreach ($deps['required']['package'] as $dep) { if ($dep['channel'] != 'pear.php.net' && $dep['channel'] != 'pecl.php.net') { $chan = &$reg->getChannel($dep['channel']); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $package = strtoupper($chan->getAlias()) . '::' . $dep['name']; } else { $package = 'PEAR::' . $dep['name']; http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Remote.php?r1=1.89&r2=1.90&diff_format=u Index: pear-core/PEAR/Command/Remote.php diff -u pear-core/PEAR/Command/Remote.php:1.89 pear-core/PEAR/Command/Remote.php:1.90 --- pear-core/PEAR/Command/Remote.php:1.89 Mon Jan 23 19:05:52 2006 +++ pear-core/PEAR/Command/Remote.php Thu Mar 2 18:14:13 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Remote.php,v 1.89 2006/01/23 19:05:52 cellog Exp $ + * @version CVS: $Id: Remote.php,v 1.90 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -158,6 +158,13 @@ function _checkChannelForStatus($channel, $chan) { + if (PEAR::isError($chan)) { + $this->raiseError($chan); + } + if (!is_a($chan, 'PEAR_ChannelFile')) { + return $this->raiseError('Internal corruption error: invalid channel "' . + $channel . '"'); + } $rest = new PEAR_REST($this->config); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); $a = $rest->downloadHttp('http://' . $channel . @@ -188,7 +195,9 @@ $channel = $parsed['channel']; $this->config->set('default_channel', $channel); $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); @@ -233,7 +242,9 @@ } } $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } $list_options = false; if ($this->config->get('preferred_state') == 'stable') { $list_options = true; @@ -299,7 +310,9 @@ $list_options = true; } $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.1', $this->config->get('preferred_mirror'))) { // use faster list-all if available @@ -415,7 +428,9 @@ } } $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); @@ -535,7 +550,9 @@ } $caption = $channel . ' Available Upgrades'; $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/PackageFile/v1.php?r1=1.68&r2=1.69&diff_format=u Index: pear-core/PEAR/PackageFile/v1.php diff -u pear-core/PEAR/PackageFile/v1.php:1.68 pear-core/PEAR/PackageFile/v1.php:1.69 --- pear-core/PEAR/PackageFile/v1.php:1.68 Fri Jan 6 04:47:37 2006 +++ pear-core/PEAR/PackageFile/v1.php Thu Mar 2 18:14:13 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: v1.php,v 1.68 2006/01/06 04:47:37 cellog Exp $ + * @version CVS: $Id: v1.php,v 1.69 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -1200,6 +1200,10 @@ } if (isset($this->_registry) && $this->_isValid) { $chan = $this->_registry->getChannel('pear.php.net'); + if (PEAR::isError($chan)) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_CHANNELVAL, $chan->getMessage()); + return $this->_isValid = 0; + } $validator = $chan->getValidationObject(); $validator->setPackageFile($this); $validator->validate($state); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/PackageFile/v2/Validator.php?r1=1.85&r2=1.86&diff_format=u Index: pear-core/PEAR/PackageFile/v2/Validator.php diff -u pear-core/PEAR/PackageFile/v2/Validator.php:1.85 pear-core/PEAR/PackageFile/v2/Validator.php:1.86 --- pear-core/PEAR/PackageFile/v2/Validator.php:1.85 Wed Feb 8 01:21:47 2006 +++ pear-core/PEAR/PackageFile/v2/Validator.php Thu Mar 2 18:14:13 2006 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Validator.php,v 1.85 2006/02/08 01:21:47 cellog Exp $ +// $Id: Validator.php,v 1.86 2006/03/02 18:14:13 cellog Exp $ /** * Private validation class used by PEAR_PackageFile_v2 - do not use directly, its * sole purpose is to split up the PEAR/PackageFile/v2.php file to make it smaller @@ -226,7 +226,7 @@ $this->_validateRelease(); if (!$this->_stack->hasErrors()) { $chan = $this->_pf->_registry->getChannel($this->_pf->getChannel(), true); - if (!$chan) { + if (PEAR::isError($chan)) { $this->_unknownChannel($this->_pf->getChannel()); } else { $valpack = $chan->getValidationPackage(); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Task/Replace.php?r1=1.14&r2=1.15&diff_format=u Index: pear-core/PEAR/Task/Replace.php diff -u pear-core/PEAR/Task/Replace.php:1.14 pear-core/PEAR/Task/Replace.php:1.15 --- pear-core/PEAR/Task/Replace.php:1.14 Mon Jan 23 05:33:00 2006 +++ pear-core/PEAR/Task/Replace.php Thu Mar 2 18:14:13 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Replace.php,v 1.14 2006/01/23 05:33:00 cellog Exp $ + * @version CVS: $Id: Replace.php,v 1.15 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -126,7 +126,7 @@ } if ($a['to'] == 'master_server') { $chan = $this->registry->getChannel($pkg->getChannel()); - if ($chan) { + if (!PEAR::isError($chan)) { $to = $chan->getServer(); } else { $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); http://cvs.php.net/viewcvs.cgi/pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt?r1=1.2&r2=1.3&diff_format=u Index: pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt diff -u pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt:1.2 pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt:1.3 --- pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt:1.2 Fri Feb 3 05:05:12 2006 +++ pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt Thu Mar 2 18:14:13 2006 @@ -25,7 +25,7 @@ ), 'pear'); $e = $command->run('channel-discover', array(), array('zornk.net')); $phpunit->assertErrors(array( - array('package' => 'PEAR_Error', 'message' => 'Discovery of channel "zornk.net" failed'), + array('package' => 'PEAR_Error', 'message' => 'Discovery of channel "zornk.net" failed (channel-add: Cannot open "http://zornk.net/channel.xml")'), ), 'zornk'); echo 'tests done'; ?>
http://cvs.php.net/viewcvs.cgi/pear-core/.cvsignore?r1=1.9&r2=1.10&diff_format=u Index: pear-core/.cvsignore diff -u pear-core/.cvsignore:1.9 pear-core/.cvsignore:1.10 --- pear-core/.cvsignore:1.9 Mon Apr 28 07:30:51 2003 +++ pear-core/.cvsignore Thu Mar 2 18:14:12 2006 @@ -4,3 +4,5 @@ run-tests php-config test.php +*.tgz +*.tar \ No newline at end of file http://cvs.php.net/viewcvs.cgi/pear-core/package-PEAR.xml?r1=1.348&r2=1.349&diff_format=u Index: pear-core/package-PEAR.xml diff -u pear-core/package-PEAR.xml:1.348 pear-core/package-PEAR.xml:1.349 --- pear-core/package-PEAR.xml:1.348 Tue Feb 21 01:18:21 2006 +++ pear-core/package-PEAR.xml Thu Mar 2 18:14:12 2006 @@ -78,38 +78,18 @@ </maintainer> </maintainers> <release> - <version>1.4.7</version> - <date>2006-02-27</date> + <version>1.4.8</version> + <date>2006-03-06</date> <license>PHP License</license> <state>stable</state> <notes> - Minor bugfix release - * Prevent packaging of release candidate releases with versions like 1.0.0rc1 - version_compare() only understands upper-case 1.0.0RC1 - * implement CLEAN section in .phpt tests - * implement run-tests command for phpunit-based tests - * implement Request #6039: setFrontendObject needed to allow objects passed - * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM - * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel - * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference - * fix Bug #6273: pear download-all fails - * fix Bug #6383: incomplete PEAR::Error message on addReplacement() - * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls - * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] - * fix Bug #6510: status active of a maintainer cannot be change - * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit - * fix Bug #6559: pear should ignore safemode/open_basedir - * fix Bug #6576: PFM2 run in trouble with sessions - * fix Bug #6579: PFM2 changelog and license with uri - * fix Bug #6673: pear install --offline --packagingroot=/blah does not work - * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration - * fix Bug #6675: postinstallscript validation fails - * fix Bug #6690: channel with / will not allow upgrade - * fix Bug #6692: Optional feature install message needs channel name - * fix Bug #6716: "pear install -r" errors after install when - attempting "pear list <pkgname>" - * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml - not in root dir + CRITICAL BUGFIX RELEASE + + Channels with "-" in their name were suddenly invalid, and + caused crashes in many places due to improper error handling + * fix Bug #6960: channels are not allowed to have "-" in their name + * fix critical Bug #6969: PEAR list-upgrades crashes + * fix Bug #6991: Class 'PEAR_PackageFile_v1' not found in Registry.php at line 1657 </notes> <provides type="class" name="OS_Guess"/> <provides type="class" name="System"/> @@ -622,5 +602,40 @@ * fix Request #6119: Add PEAR_Frontend_Gtk2 support to PEAR </notes> </release> + <release> + <version>1.4.7</version> + <date>2006-02-27</date> + <license>PHP License</license> + <state>stable</state> + <notes> + Minor bugfix release + * Prevent packaging of release candidate releases with versions like 1.0.0rc1 + version_compare() only understands upper-case 1.0.0RC1 + * implement CLEAN section in .phpt tests + * implement run-tests command for phpunit-based tests + * implement Request #6039: setFrontendObject needed to allow objects passed + * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM + * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel + * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference + * fix Bug #6273: pear download-all fails + * fix Bug #6383: incomplete PEAR::Error message on addReplacement() + * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls + * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] + * fix Bug #6510: status active of a maintainer cannot be change + * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit + * fix Bug #6559: pear should ignore safemode/open_basedir + * fix Bug #6576: PFM2 run in trouble with sessions + * fix Bug #6579: PFM2 changelog and license with uri + * fix Bug #6673: pear install --offline --packagingroot=/blah does not work + * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration + * fix Bug #6675: postinstallscript validation fails + * fix Bug #6690: channel with / will not allow upgrade + * fix Bug #6692: Optional feature install message needs channel name + * fix Bug #6716: "pear install -r" errors after install when + attempting "pear list <pkgname>" + * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml + not in root dir + </notes> + </release> </changelog> </package> http://cvs.php.net/viewcvs.cgi/pear-core/package2.xml?r1=1.242&r2=1.243&diff_format=u Index: pear-core/package2.xml diff -u pear-core/package2.xml:1.242 pear-core/package2.xml:1.243 --- pear-core/package2.xml:1.242 Tue Feb 21 01:18:21 2006 +++ pear-core/package2.xml Thu Mar 2 18:14:12 2006 @@ -77,10 +77,10 @@ <email>mj@php.net</email> <active>no</active> </helper> - <date>2006-02-27</date> + <date>2006-03-06</date> <version> - <release>1.4.7</release> - <api>1.4.1</api> + <release>1.4.8</release> + <api>1.4.2</api> </version> <stability> <release>stable</release> @@ -88,33 +88,13 @@ </stability> <license uri="http://www.php.net/license">PHP License</license> <notes> - Minor bugfix release - * Prevent packaging of release candidate releases with versions like 1.0.0rc1 - version_compare() only understands upper-case 1.0.0RC1 - * implement CLEAN section in .phpt tests - * implement run-tests command for phpunit-based tests - * implement Request #6039: setFrontendObject needed to allow objects passed - * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM - * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel - * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference - * fix Bug #6273: pear download-all fails - * fix Bug #6383: incomplete PEAR::Error message on addReplacement() - * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls - * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] - * fix Bug #6510: status active of a maintainer cannot be change - * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit - * fix Bug #6559: pear should ignore safemode/open_basedir - * fix Bug #6576: PFM2 run in trouble with sessions - * fix Bug #6579: PFM2 changelog and license with uri - * fix Bug #6673: pear install --offline --packagingroot=/blah does not work - * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration - * fix Bug #6675: postinstallscript validation fails - * fix Bug #6690: channel with / will not allow upgrade - * fix Bug #6692: Optional feature install message needs channel name - * fix Bug #6716: "pear install -r" errors after install when - attempting "pear list <pkgname>" - * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml - not in root dir + CRITICAL BUGFIX RELEASE + + Channels with "-" in their name were suddenly invalid, and + caused crashes in many places due to improper error handling + * fix Bug #6960: channels are not allowed to have "-" in their name + * fix critical Bug #6969: PEAR list-upgrades crashes + * fix Bug #6991: Class 'PEAR_PackageFile_v1' not found in Registry.php at line 1657 </notes> <contents> <dir name="/"> @@ -769,5 +749,46 @@ * fix Request #6119: Add PEAR_Frontend_Gtk2 support to PEAR </notes> </release> + <release> + <version> + <release>1.4.7</release> + <api>1.4.1</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <date>2006-02-27</date> + <license uri="http://www.php.net/license/3_0.txt">PHP License</license> + <notes> + Minor bugfix release + * Prevent packaging of release candidate releases with versions like 1.0.0rc1 + version_compare() only understands upper-case 1.0.0RC1 + * implement CLEAN section in .phpt tests + * implement run-tests command for phpunit-based tests + * implement Request #6039: setFrontendObject needed to allow objects passed + * fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM + * fix Bug #6076: optional is not set for conversion of package2.xml to "has" rel + * fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference + * fix Bug #6273: pear download-all fails + * fix Bug #6383: incomplete PEAR::Error message on addReplacement() + * fix Bug #6445: PEAR::registerShutdownFunc doesn't work in static calls + * fix Bug #6480: pear install --installroot option fails for pecl packages [timj] + * fix Bug #6510: status active of a maintainer cannot be change + * fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit + * fix Bug #6559: pear should ignore safemode/open_basedir + * fix Bug #6576: PFM2 run in trouble with sessions + * fix Bug #6579: PFM2 changelog and license with uri + * fix Bug #6673: pear install --offline --packagingroot=/blah does not work + * fix Bug #6674: --packagingroot always uses channel pear.php.net configuration + * fix Bug #6675: postinstallscript validation fails + * fix Bug #6690: channel with / will not allow upgrade + * fix Bug #6692: Optional feature install message needs channel name + * fix Bug #6716: "pear install -r" errors after install when + attempting "pear list <pkgname>" + * fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn't work with package.xml + not in root dir + </notes> + </release> </changelog> </package> http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/ChannelFile.php?r1=1.74&r2=1.75&diff_format=u Index: pear-core/PEAR/ChannelFile.php diff -u pear-core/PEAR/ChannelFile.php:1.74 pear-core/PEAR/ChannelFile.php:1.75 --- pear-core/PEAR/ChannelFile.php:1.74 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/ChannelFile.php Thu Mar 2 18:14:12 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: ChannelFile.php,v 1.74 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: ChannelFile.php,v 1.75 2006/03/02 18:14:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -324,6 +324,20 @@ } return $a; } + + /** + * Unlike {@link fromArray()} this does not do any validation + * @param array + * @static + * @return PEAR_ChannelFile + */ + function &fromArrayWithErrors($data, $compatibility = false, + $stackClass = 'PEAR_ErrorStack') + { + $a = new PEAR_ChannelFile($compatibility, $stackClass); + $a->_fromArray($data); + return $a; + } /** * @param array http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Common.php?r1=1.154&r2=1.155&diff_format=u Index: pear-core/PEAR/Common.php diff -u pear-core/PEAR/Common.php:1.154 pear-core/PEAR/Common.php:1.155 --- pear-core/PEAR/Common.php:1.154 Sat Feb 4 05:01:55 2006 +++ pear-core/PEAR/Common.php Thu Mar 2 18:14:12 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Common.php,v 1.154 2006/02/04 05:01:55 cellog Exp $ + * @version CVS: $Id: Common.php,v 1.155 2006/03/02 18:14:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1.0 * @deprecated File deprecated since Release 1.4.0a1 @@ -51,7 +51,7 @@ define('PEAR_CHANNELS_NAME_PREG', '/^' . _PEAR_CHANNELS_NAME_PREG . '$/'); // this should allow any dns or IP address, plus a path - NO UNDERSCORES ALLOWED -define('_PEAR_CHANNELS_SERVER_PREG', '[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*(\/[a-zA-Z0-9]+)*'); +define('_PEAR_CHANNELS_SERVER_PREG', '[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*(\/[a-zA-Z0-9\-]+)*'); define('PEAR_CHANNELS_SERVER_PREG', '/^' . _PEAR_CHANNELS_SERVER_PREG . '$/i'); define('_PEAR_CHANNELS_PACKAGE_PREG', '(' ._PEAR_CHANNELS_SERVER_PREG . ')\/(' http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Config.php?r1=1.123&r2=1.124&diff_format=u Index: pear-core/PEAR/Config.php diff -u pear-core/PEAR/Config.php:1.123 pear-core/PEAR/Config.php:1.124 --- pear-core/PEAR/Config.php:1.123 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Config.php Thu Mar 2 18:14:12 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Config.php,v 1.123 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Config.php,v 1.124 2006/03/02 18:14:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -1265,6 +1265,9 @@ $reg = &$this->getRegistry(); if (is_object($reg)) { $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } if (!$chan->getMirror($test) && $chan->getName() != $test) { return $channel; // mirror does not exist } @@ -1286,6 +1289,9 @@ $reg = &$this->getRegistry(); if (is_object($reg)) { $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } if (!$chan->getMirror($test) && $chan->getName() != $test) { return $channel; // mirror does not exist } @@ -1329,6 +1335,9 @@ $reg = &$this->getRegistry($layer); if (is_object($reg)) { $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } if (!$chan->getMirror($ret) && $chan->getName() != $ret) { return $channel; // mirror does not exist } @@ -1383,6 +1392,9 @@ $reg = &$this->getRegistry($layer); if (is_object($reg)) { $chan = &$reg->getChannel($channel ? $channel : 'pear.php.net'); + if (PEAR::isError($chan)) { + return false; + } if (!$chan->getMirror($value) && $chan->getName() != $value) { return false; // mirror does not exist } http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Downloader.php?r1=1.98&r2=1.99&diff_format=u Index: pear-core/PEAR/Downloader.php diff -u pear-core/PEAR/Downloader.php:1.98 pear-core/PEAR/Downloader.php:1.99 --- pear-core/PEAR/Downloader.php:1.98 Thu Feb 2 17:16:51 2006 +++ pear-core/PEAR/Downloader.php Thu Mar 2 18:14:13 2006 @@ -18,7 +18,7 @@ * @author Martin Jansen <mj@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Downloader.php,v 1.98 2006/02/02 17:16:51 cellog Exp $ + * @version CVS: $Id: Downloader.php,v 1.99 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.0 */ @@ -301,6 +301,10 @@ require_once 'System.php'; } $curchannel = &$this->_registry->getChannel($params[$i]->getChannel()); + if (PEAR::isError($curchannel)) { + PEAR::staticPopErrorHandling(); + return $this->raiseError($curchannel); + } $a = $this->downloadHttp('http://' . $params[$i]->getChannel() . '/channel.xml', $this->ui, System::mktemp(array('-d')), null, $curchannel->lastModified()); @@ -719,6 +723,9 @@ } while (false); } $chan = &$this->_registry->getChannel($parr['channel']); + if (PEAR::isError($chan)) { + return $chan; + } $version = $this->_registry->packageInfo($parr['package'], 'version', $parr['channel']); if ($chan->supportsREST($this->config->get('preferred_mirror')) && @@ -857,6 +864,9 @@ unset($parr['state']); } $chan = &$this->_registry->getChannel($remotechannel); + if (PEAR::isError($chan)) { + return $chan; + } $version = $this->_registry->packageInfo($dep['name'], 'version', $remotechannel); if ($chan->supportsREST($this->config->get('preferred_mirror')) && @@ -964,6 +974,9 @@ $package = "http://pear.php.net/get/$package"; } else { $chan = $this->_registry->getChannel($channel); + if (PEAR::isError($chan)) { + return ''; + } $package = "http://" . $chan->getServer() . "/get/$package"; } if (!extension_loaded("zlib")) { http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Registry.php?r1=1.147&r2=1.148&diff_format=u Index: pear-core/PEAR/Registry.php diff -u pear-core/PEAR/Registry.php:1.147 pear-core/PEAR/Registry.php:1.148 --- pear-core/PEAR/Registry.php:1.147 Sat Feb 4 06:04:29 2006 +++ pear-core/PEAR/Registry.php Thu Mar 2 18:14:13 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Registry.php,v 1.147 2006/02/04 06:04:29 cellog Exp $ + * @version CVS: $Id: Registry.php,v 1.148 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -536,6 +536,9 @@ return false; } $channel = $this->_getChannel($channel); + if (PEAR::isError($channel)) { + return $channel; + } return $channel->getAlias(); } // }}} @@ -836,6 +839,9 @@ return false; } $checker = $this->_getChannel($channel->getName()); + if (PEAR::isError($channel)) { + return $channel; + } if ($channel->getAlias() != $checker->getAlias()) { @unlink($this->_getChannelAliasFileName($checker->getAlias())); } @@ -1288,7 +1294,7 @@ /** * @param string channel name * @param bool whether to strictly retrieve channel names - * @return PEAR_ChannelFile|false + * @return PEAR_ChannelFile|PEAR_Error * @access private */ function &_getChannel($channel, $noaliases = false) @@ -1298,9 +1304,9 @@ if (!class_exists('PEAR_ChannelFile')) { require_once 'PEAR/ChannelFile.php'; } - $ch = &PEAR_ChannelFile::fromArray($this->_channelInfo($channel, $noaliases)); + $ch = &PEAR_ChannelFile::fromArrayWithErrors($this->_channelInfo($channel, $noaliases)); } - if ($ch) { + if ($ch->validate()) { return $ch; } if ($this->_getChannelFromAlias($channel) == 'pear.php.net') { @@ -1343,6 +1349,10 @@ $private->setSummary('Pseudo-channel for static packages'); return $private; } + foreach ($ch->getErrors(true) as $err) { + $message = $err['message'] . "\n"; + } + $ch = PEAR::raiseError($message); return $ch; } @@ -1654,6 +1664,9 @@ $ret = $this->_updatePackage($package, $info, $merge); $this->_unlock(); if ($ret) { + if (!class_exists('PEAR_PackageFile_v1')) { + require_once 'PEAR/PackageFile/v1.php'; + } $pf = new PEAR_PackageFile_v1; $pf->setConfig($this->_config); $pf->fromArray($this->packageInfo($package)); @@ -1691,7 +1704,7 @@ /** * @param string channel name * @param bool whether to strictly return raw channels (no aliases) - * @return PEAR_ChannelFile|false + * @return PEAR_ChannelFile|PEAR_Error */ function &getChannel($channel, $noaliases = false) { @@ -1792,7 +1805,11 @@ return $e; } foreach ($this->_listChannels() as $channel) { - $ret[] = &$this->_getChannel($channel); + $e = &$this->_getChannel($channel); + if (PEAR::isError($e)) { + continue; + } + $ret[] = $e; } $this->_unlock(); return $ret; http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Remote.php?r1=1.75&r2=1.76&diff_format=u Index: pear-core/PEAR/Remote.php diff -u pear-core/PEAR/Remote.php:1.75 pear-core/PEAR/Remote.php:1.76 --- pear-core/PEAR/Remote.php:1.75 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Remote.php Thu Mar 2 18:14:13 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Remote.php,v 1.75 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Remote.php,v 1.76 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -151,7 +151,7 @@ $server_channel = $this->config->get('default_channel'); $channel = $this->_registry->getChannel($server_channel); - if ($channel) { + if (!PEAR::isError($channel)) { $mirror = $this->config->get('preferred_mirror'); if ($channel->getMirror($mirror)) { if ($channel->supports('xmlrpc', $method, $mirror)) { @@ -277,7 +277,7 @@ } while (false); $server_channel = $this->config->get('default_channel'); $channel = $this->_registry->getChannel($server_channel); - if ($channel) { + if (!PEAR::isError($channel)) { $mirror = $this->config->get('preferred_mirror'); if ($channel->getMirror($mirror)) { if ($channel->supports('xmlrpc', $method, $mirror)) { http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Auth.php?r1=1.22&r2=1.23&diff_format=u Index: pear-core/PEAR/Command/Auth.php diff -u pear-core/PEAR/Command/Auth.php:1.22 pear-core/PEAR/Command/Auth.php:1.23 --- pear-core/PEAR/Command/Auth.php:1.22 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Command/Auth.php Thu Mar 2 18:14:13 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Auth.php,v 1.22 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Auth.php,v 1.23 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -108,6 +108,9 @@ $reg = &$this->config->getRegistry(); $channel = $this->config->get('default_channel'); $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $server = $this->config->get('preferred_mirror'); $remote = &$this->config->getRemote(); $username = $this->config->get('username'); @@ -166,6 +169,9 @@ $reg = &$this->config->getRegistry(); $channel = $this->config->get('default_channel'); $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $server = $this->config->get('preferred_mirror'); $this->ui->outputData("Logging out from $server.", $command); $this->config->remove('username'); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Channels.php?r1=1.43&r2=1.44&diff_format=u Index: pear-core/PEAR/Command/Channels.php diff -u pear-core/PEAR/Command/Channels.php:1.43 pear-core/PEAR/Command/Channels.php:1.44 --- pear-core/PEAR/Command/Channels.php:1.43 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Command/Channels.php Thu Mar 2 18:14:13 2006 @@ -18,7 +18,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Channels.php,v 1.43 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Channels.php,v 1.44 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -218,7 +218,7 @@ if ($reg->channelExists($channel, true)) { $this->ui->outputData("Updating channel \"$channel\"", $command); $test = $reg->getChannel($channel, true); - if (!$test) { + if (PEAR::isError($test)) { $this->ui->outputData("Channel '$channel' is corrupt in registry!", $command); $lastmodified = false; } else { @@ -266,6 +266,9 @@ } else { if ($reg->isAlias($channel)) { $temp = &$reg->getChannel($channel); + if (PEAR::isError($temp)) { + return $this->raiseError($temp); + } $temp->setAlias($temp->getName(), true); // set the alias to the channel name if ($reg->channelExists($temp->getName())) { $this->ui->outputData('ERROR: existing channel "' . $temp->getName() . @@ -323,6 +326,9 @@ $channel = strtolower($params[0]); if ($reg->channelExists($channel)) { $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } } else { if (strpos($channel, '://')) { $downloader = &$this->getDownloader(); @@ -600,6 +606,9 @@ if ((!file_exists($params[0]) || is_dir($params[0])) && $reg->channelExists(strtolower($params[0]))) { $c = $reg->getChannel(strtolower($params[0])); + if (PEAR::isError($c)) { + return $this->raiseError($c); + } $this->ui->outputData('Retrieving channel.xml from remote server'); $dl = &$this->getDownloader(array()); // if force is specified, use a timestamp of "1" to force retrieval @@ -729,9 +738,9 @@ 'already aliased to "' . strtolower($params[1]) . '", cannot re-alias'); } $chan = &$reg->getChannel($params[0]); - if (!$chan) { + if (PEAR::isError($chan)) { return $this->raiseError('Corrupt registry? Error retrieving channel "' . $params[0] . - '" information'); + '" information (' . $chan->getMessage() . ')'); } // make it a local alias if (!$chan->setAlias(strtolower($params[1]), true)) { @@ -762,7 +771,8 @@ $err = $this->doAdd($command, $options, array('http://' . $params[0] . '/channel.xml')); $this->popErrorHandling(); if (PEAR::isError($err)) { - return $this->raiseError("Discovery of channel \"$params[0]\" failed"); + return $this->raiseError("Discovery of channel \"$params[0]\" failed (" . + $err->getMessage() . ')'); } $this->ui->outputData("Discovery of channel \"$params[0]\" succeeded", $command); } http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Install.php?r1=1.114&r2=1.115&diff_format=u Index: pear-core/PEAR/Command/Install.php diff -u pear-core/PEAR/Command/Install.php:1.114 pear-core/PEAR/Command/Install.php:1.115 --- pear-core/PEAR/Command/Install.php:1.114 Mon Feb 6 00:36:27 2006 +++ pear-core/PEAR/Command/Install.php Thu Mar 2 18:14:13 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Install.php,v 1.114 2006/02/06 00:36:27 cellog Exp $ + * @version CVS: $Id: Install.php,v 1.115 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -371,6 +371,9 @@ } $this->config->set('default_channel', $channel); $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $dorest = true; http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Mirror.php?r1=1.17&r2=1.18&diff_format=u Index: pear-core/PEAR/Command/Mirror.php diff -u pear-core/PEAR/Command/Mirror.php:1.17 pear-core/PEAR/Command/Mirror.php:1.18 --- pear-core/PEAR/Command/Mirror.php:1.17 Mon Jan 23 19:05:52 2006 +++ pear-core/PEAR/Command/Mirror.php Thu Mar 2 18:14:13 2006 @@ -15,7 +15,7 @@ * @author Alexander Merz <alexmerz@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Mirror.php,v 1.17 2006/01/23 19:05:52 cellog Exp $ + * @version CVS: $Id: Mirror.php,v 1.18 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.2.0 */ @@ -113,6 +113,9 @@ $this->config->set('default_channel', $channel); $this->ui->outputData('Using Channel ' . $this->config->get('default_channel')); $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Package.php?r1=1.118&r2=1.119&diff_format=u Index: pear-core/PEAR/Command/Package.php diff -u pear-core/PEAR/Command/Package.php:1.118 pear-core/PEAR/Command/Package.php:1.119 --- pear-core/PEAR/Command/Package.php:1.118 Tue Feb 21 00:59:13 2006 +++ pear-core/PEAR/Command/Package.php Thu Mar 2 18:14:13 2006 @@ -18,7 +18,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Package.php,v 1.118 2006/02/21 00:59:13 cellog Exp $ + * @version CVS: $Id: Package.php,v 1.119 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -823,6 +823,9 @@ $alias = 'PEAR'; } else { $chan = &$reg->getChannel($pf->getChannel()); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $alias = $chan->getAlias(); $alias = strtoupper($alias); $info['possible_channel'] = $pf->getChannel() . '/'; @@ -892,6 +895,9 @@ foreach ($cfg as $k) { if ($k == 'master_server') { $chan = $reg->getChannel($pf->getChannel()); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $info[$k] = $chan->getServer(); continue; } @@ -918,6 +924,9 @@ if (isset($dep['channel']) && $dep['channel'] != 'pear.php.net' && $dep['channel'] != 'pecl.php.net') { $chan = &$reg->getChannel($dep['channel']); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $package = strtoupper($chan->getAlias()) . '::' . $dep['name']; } else { $package = 'PEAR::' . $dep['name']; @@ -961,6 +970,9 @@ foreach ($deps['required']['package'] as $dep) { if ($dep['channel'] != 'pear.php.net' && $dep['channel'] != 'pecl.php.net') { $chan = &$reg->getChannel($dep['channel']); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } $package = strtoupper($chan->getAlias()) . '::' . $dep['name']; } else { $package = 'PEAR::' . $dep['name']; http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Remote.php?r1=1.89&r2=1.90&diff_format=u Index: pear-core/PEAR/Command/Remote.php diff -u pear-core/PEAR/Command/Remote.php:1.89 pear-core/PEAR/Command/Remote.php:1.90 --- pear-core/PEAR/Command/Remote.php:1.89 Mon Jan 23 19:05:52 2006 +++ pear-core/PEAR/Command/Remote.php Thu Mar 2 18:14:13 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Remote.php,v 1.89 2006/01/23 19:05:52 cellog Exp $ + * @version CVS: $Id: Remote.php,v 1.90 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -158,6 +158,13 @@ function _checkChannelForStatus($channel, $chan) { + if (PEAR::isError($chan)) { + $this->raiseError($chan); + } + if (!is_a($chan, 'PEAR_ChannelFile')) { + return $this->raiseError('Internal corruption error: invalid channel "' . + $channel . '"'); + } $rest = new PEAR_REST($this->config); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); $a = $rest->downloadHttp('http://' . $channel . @@ -188,7 +195,9 @@ $channel = $parsed['channel']; $this->config->set('default_channel', $channel); $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); @@ -233,7 +242,9 @@ } } $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } $list_options = false; if ($this->config->get('preferred_state') == 'stable') { $list_options = true; @@ -299,7 +310,9 @@ $list_options = true; } $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.1', $this->config->get('preferred_mirror'))) { // use faster list-all if available @@ -415,7 +428,9 @@ } } $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); @@ -535,7 +550,9 @@ } $caption = $channel . ' Available Upgrades'; $chan = $reg->getChannel($channel); - $this->_checkChannelForStatus($channel, $chan); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } if ($chan->supportsREST($this->config->get('preferred_mirror')) && $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { $rest = &$this->config->getREST('1.0', array()); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/PackageFile/v1.php?r1=1.68&r2=1.69&diff_format=u Index: pear-core/PEAR/PackageFile/v1.php diff -u pear-core/PEAR/PackageFile/v1.php:1.68 pear-core/PEAR/PackageFile/v1.php:1.69 --- pear-core/PEAR/PackageFile/v1.php:1.68 Fri Jan 6 04:47:37 2006 +++ pear-core/PEAR/PackageFile/v1.php Thu Mar 2 18:14:13 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: v1.php,v 1.68 2006/01/06 04:47:37 cellog Exp $ + * @version CVS: $Id: v1.php,v 1.69 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -1200,6 +1200,10 @@ } if (isset($this->_registry) && $this->_isValid) { $chan = $this->_registry->getChannel('pear.php.net'); + if (PEAR::isError($chan)) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_CHANNELVAL, $chan->getMessage()); + return $this->_isValid = 0; + } $validator = $chan->getValidationObject(); $validator->setPackageFile($this); $validator->validate($state); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/PackageFile/v2/Validator.php?r1=1.85&r2=1.86&diff_format=u Index: pear-core/PEAR/PackageFile/v2/Validator.php diff -u pear-core/PEAR/PackageFile/v2/Validator.php:1.85 pear-core/PEAR/PackageFile/v2/Validator.php:1.86 --- pear-core/PEAR/PackageFile/v2/Validator.php:1.85 Wed Feb 8 01:21:47 2006 +++ pear-core/PEAR/PackageFile/v2/Validator.php Thu Mar 2 18:14:13 2006 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Validator.php,v 1.85 2006/02/08 01:21:47 cellog Exp $ +// $Id: Validator.php,v 1.86 2006/03/02 18:14:13 cellog Exp $ /** * Private validation class used by PEAR_PackageFile_v2 - do not use directly, its * sole purpose is to split up the PEAR/PackageFile/v2.php file to make it smaller @@ -226,7 +226,7 @@ $this->_validateRelease(); if (!$this->_stack->hasErrors()) { $chan = $this->_pf->_registry->getChannel($this->_pf->getChannel(), true); - if (!$chan) { + if (PEAR::isError($chan)) { $this->_unknownChannel($this->_pf->getChannel()); } else { $valpack = $chan->getValidationPackage(); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Task/Replace.php?r1=1.14&r2=1.15&diff_format=u Index: pear-core/PEAR/Task/Replace.php diff -u pear-core/PEAR/Task/Replace.php:1.14 pear-core/PEAR/Task/Replace.php:1.15 --- pear-core/PEAR/Task/Replace.php:1.14 Mon Jan 23 05:33:00 2006 +++ pear-core/PEAR/Task/Replace.php Thu Mar 2 18:14:13 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Replace.php,v 1.14 2006/01/23 05:33:00 cellog Exp $ + * @version CVS: $Id: Replace.php,v 1.15 2006/03/02 18:14:13 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -126,7 +126,7 @@ } if ($a['to'] == 'master_server') { $chan = $this->registry->getChannel($pkg->getChannel()); - if ($chan) { + if (!PEAR::isError($chan)) { $to = $chan->getServer(); } else { $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); http://cvs.php.net/viewcvs.cgi/pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt?r1=1.2&r2=1.3&diff_format=u Index: pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt diff -u pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt:1.2 pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt:1.3 --- pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt:1.2 Fri Feb 3 05:05:12 2006 +++ pear-core/tests/PEAR_Command_Channels/channel-discover/test_fail.phpt Thu Mar 2 18:14:13 2006 @@ -25,7 +25,7 @@ ), 'pear'); $e = $command->run('channel-discover', array(), array('zornk.net')); $phpunit->assertErrors(array( - array('package' => 'PEAR_Error', 'message' => 'Discovery of channel "zornk.net" failed'), + array('package' => 'PEAR_Error', 'message' => 'Discovery of channel "zornk.net" failed (channel-add: Cannot open "http://zornk.net/channel.xml")'), ), 'zornk'); echo 'tests done'; ?>