php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56135 pear search <term>
Submitted: 2004-07-16 17:02 UTC Modified: 2005-02-26 22:37 UTC
From: danielc at analysisandsolutions dot com Assigned: pajoye (profile)
Status: Closed Package: PECL website (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: danielc at analysisandsolutions dot com
New email:
PHP Version: OS:

 

 [2004-07-16 17:02 UTC] danielc at analysisandsolutions dot com
Description:
------------
Matthew Weier O'Phinney posted on pear-general, and then Norbert Mocsnik forwarded to pear-dev the following issue.



> I get the following when I run a 'pear search xxx': 
> 
> Warning: Invalid argument supplied for foreach() in Remote.php on line 263
> no packages found


Line 263 is part of the the doSearch() method in pear/PEAR/Command/Remote.php.  That line is
    foreach ($available as $name => $info) {

$available comes from:

    $r = new PEAR_Remote($this->config);
    $available = $r->call('package.listAll', true, false);

call() then invokes XML RPC and caching, passing 'package.listAll' to a new XML_RPC_Message object that then gets passed to XML_RPC_Client::send().

Something along the way is returning bad info for some reason.  Then the error isn't being handled properly before being passed to the foreach.

Both issues need addressing.  I'll leave resolving these matters up to the folks who are more familliar with the inner workings of all this.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-17 10:28 UTC] pierre at dotgeek dot org
Fixed. The cache was broken for an unknown reason. Did you guys change something recently?

If you get this problem again, please reopen this bug.

--Pierre
 [2004-07-17 13:54 UTC] danielc at analysisandsolutions dot com
Pierre:

For now, putting the issue of why the cache is becoming corrupted, it would be very helpful if you could please debug why PEAR_Remote::call(), or it's sub-calls, is returning data other than an array rather than raising an error.  Perhaps they have raised an error, but that error isn't being properly cought.  The goal being to get a real, helpful, error message to be displayed rather than the irrelevant "invalid argument supplied for foreach."

Thanks.
 [2005-02-26 22:37 UTC] cellog@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/Web Site

This is fixed in PEAR 1.4.0a1 and newer
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 09:01:28 2024 UTC