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

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

-Summary: REST/10.php:295 does not check error condition
+Summary: REST/10.php does not check error condition
-Status: Assigned
+Status: Closed
This bug has been fixed in SVN.

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.

I couldn't reproduce the exact problem but that specific case of
retrieveData was
missing an error check in any case and is now handled more gracefully.


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

[2011-05-29 14:27:40] doconnor

-Assigned To:
+Assigned To: dufuz


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

[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
postedJun 1, '11 at 4:56a
activeJun 1, '11 at 4:56a
posts1
users1
websitepear.php.net

1 user in discussion

Helgith: 1 post

People

Translate

site design / logo © 2021 Grokbase