Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #7015 install a package.tgz with unknown channel, fatal error in PEAR/Registry.php
Submitted: 2006-03-04 12:36 UTC
From: toggg Assigned: cellog
Status: Closed Package: PEAR (version CVS)
PHP Version: 4.3.11 OS: fc3
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 7 - 2 = ?

 
 [2006-03-04 12:36 UTC] toggg (bertrand Gugger)
Description: ------------ PHP Fatal error: Call to a member function on a non-object in /usr/share/pear/PEAR/Registry.php on line 1309 If corrected as follows then : PHP Fatal error: Call to a member function on a non-object in /usr/share/pear/PEAR/Registry.php on line 1352 I tried to apply joined patch, but now I get: PHP Notice: Undefined variable: message in /usr/share/pear/PEAR/Registry.php on line 1357 Not sure about what you want in this foreach() and eventually what default message should be set... Test script: --------------- --- ../PEAR/Registry.php 2006-03-03 08:28:39.000000000 +0100 +++ /usr/share/pear/PEAR/Registry.php 2006-03-04 13:23:49.000000000 +0100 @@ -1306,7 +1306,7 @@ } $ch = &PEAR_ChannelFile::fromArrayWithErrors($this->_channelInfo($channel, $noaliases)); } - if ($ch->validate()) { + if ($ch && $ch->validate()) { return $ch; } if ($this->_getChannelFromAlias($channel) == 'pear.php.net') { @@ -1349,8 +1349,10 @@ $private->setSummary('Pseudo-channel for static packages'); return $private; } - foreach ($ch->getErrors(true) as $err) { - $message = $err['message'] . "\n"; + if ($ch) { + foreach ($ch->getErrors(true) as $err) { + $message = $err['message'] . "\n"; + } } $ch = PEAR::raiseError($message); return $ch;

Comments

 [2006-03-04 15:06 UTC] cellog
what were you doing to create this error??
 [2006-03-04 15:21 UTC] cellog
never mind - I just realized how this could happen (unknown channel when installing downloaded .tgz)
 [2006-03-04 15:26 UTC] cellog
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.