FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18486&edit=1

ID: 18486
Updated by: daniel.oconnor@gmail.com
Reported By: le dot ben dot smith at gmail dot com
Summary: REST/10.php:295 does not check error condition
Status: Open
Type: Bug
Package: PEAR
Operating System: Fedora 13
Package Version: 1.9.2
PHP Version: 5.3.6
-Assigned To:
+Assigned To: dufuz
Roadmap Versions:
New Comment:

-Assigned To:
+Assigned To: dufuz



Previous Comments:
------------------------------------------------------------------------

[2011-04-27 19:52:01] bensmith

Description:
------------
When trying to install Horde using "pear install", I sometimes get this
error:

PHP Fatal error: Cannot use object of type PEAR_Error as array in
/usr/share/pear/PEAR/REST/10.php on line 295

Here is the code causing the problem:

293 $allinfo = $this->_rest->retrieveData($base . 'r/' .
$packageLower .
294 '/allreleases.xml', false, false, $channel);
295 if (!is_array($allinfo['r']) ||
!isset($allinfo['r'][0])) {
296 $allinfo['r'] = array($allinfo['r']);
297 }

It looks like the problem is that retrieveData's output needs to be
checked for an error condition.


Test script:
---------------
I was using the pear tool like this:

pear install horde/Kronolith

~20 minutes later, I ran the same command, and didn't get the error.

This appears to be an intermittent problem, maybe (?) caused by not
being able to connect to horde.pear.org.

Expected result:
----------------
I would expect a more informative error message. This error message is
confusing for the user because it does not indicate that there is,
probably, a problem at the REST protocol level.

Actual result:
--------------
PHP Fatal error: Cannot use object of type PEAR_Error as array in
/usr/share/pear/PEAR/REST/10.php on line 295

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 29, '11 at 1:28p
activeMay 29, '11 at 1:28p
posts1
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 1 post

People

Translate

site design / logo © 2021 Grokbase