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

Bug #2314 "Backend not Supported" error
Submitted: 2004-09-11 16:33 UTC
From: acc_pear at riggers dot me dot uk Assigned: jan
Status: Closed Package: Net_Ping
PHP Version: 5.0.0 OS: linux fedora core 2
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 : 49 + 42 = ?

 
 [2004-09-11 16:33 UTC] acc_pear at riggers dot me dot uk
Description: ------------ Version 2.4 of Net_Ping throws a pear error with message "Backend not supported" I believe this is down to the change in implementation of get_class_methods() in PHP5 - the strings returned are case-sensitive. This causes the Net_Ping_Result::_prepareParseResult() to fail, as "_parseresultlinux" doesn't exist in the array of class methods. Suggest return in_array('_parseresult'.$sysname, $parse_methods); is changed to return in_array('_parseResult'.$sysname, $parse_methods); in Net_Ping_Result::_prepareParseResult() Reproduce code: --------------- require_once('Net/Ping.php'); $p = Net_Ping::factory(); $res = $p->ping('172.0.0.10'); if( PEAR::isError($res) ) { echo $res->getMessage(); } Expected result: ---------------- No error message Actual result: -------------- "Backend not Supported"

Comments

 [2004-09-11 17:16 UTC] acc_pear at riggers dot me dot uk
oops. Of course: return in_array('_parseResult'.$sysname, $parse_methods); will break php4...
 [2004-09-19 18:09 UTC] acc_pear at riggers dot me dot uk
Patch to fix for both php4 and 5 Index: Ping.php =================================================================== RCS file: /repository/pear/Net_Ping/Ping.php,v retrieving revision 1.38 diff -u -r1.38 Ping.php --- Ping.php 21 Jul 2004 14:27:25 -0000 1.38 +++ Ping.php 19 Sep 2004 12:47:46 -0000 @@ -633,7 +633,7 @@ */ function _prepareParseResult($sysname) { - $parse_methods = array_values(get_class_methods('Net_Ping_Result')); + $parse_methods = array_values(array_map('strtolower',get_class_methods('Net_Ping_Result'))); return in_array('_parseresult'.$sysname, $parse_methods); } /* function _prepareParseResult() */
 [2005-03-25 22:19 UTC] bertolinisj at earthlink dot net
This fix for #2314 can also be applied to the NET_Traceroute package as it is plagued by the same bug. The _prepareParseResult function of the Net_Traceroute_Result Container Class has the same issue and failed for me on win 2000 and XP when using the sample: Hope this helps Sergio Bertolini
 [2005-09-13 02:00 UTC] ohmer at epita dot info
this bug report is 1 year old and the tarball i installed via pear install Net_Ping is still not patched. will that be done a day ?
 [2005-12-18 04:04 UTC] eqguy2002 at yahoo dot com
Thanks for posting the fix. I have been beating my head against my desk trying to figure out the problem.
 [2005-12-19 21:50 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!