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

Bug #12659 OS Detection incorrect
Submitted: 2007-12-11 18:41 UTC
From: sharms Assigned: cconstantine
Status: Closed Package: Net_Ping (version 2.4.2)
PHP Version: 5.2.2 OS: Suse Linux 9/10
Roadmaps: 2.4.3    
Subscription  


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 : 33 + 14 = ?

 
 [2007-12-11 18:41 UTC] sharms (Steven Harms)
Description: ------------ Default 'linux' argument map is incorrect, most require the linuxredhat9 argument map. This patch is for Suse 9/10 / Ubuntu Gutsy. --- /home/support/Ping.bak 2007-12-11 13:30:56.464436661 -0500 +++ Ping.php 2007-12-11 13:38:08.260503688 -0500 @@ -176,17 +176,22 @@ // the ping output. Elsewhere, we'll set $sysname back before // that. if ('linux' == $sysname) { - if (file_exists('/etc/debian_version')) { + if (file_exists('/etc/lsb-release') && false !== ($release= @file_get_contents('/etc/lsb-release')) && (preg_match('/gutsy/i', $release))) + { + $sysname = 'linuxredhat9'; + } else if (file_exists('/etc/debian_version')) { $sysname = 'linuxdebian'; - }else if (file_exists('/etc/redhat-release') + } else if (file_exists('/etc/redhat-release') && false !== ($release= @file_get_contents('/etc/redhat-release')) ) { if (preg_match('/release 8/i', $release)) { $sysname = 'linuxredhat8'; - }elseif (preg_match('/release 9/i', $release)) { + } elseif (preg_match('/release 9/i', $release)) { $sysname = 'linuxredhat9'; } + } else if (file_exists('/etc/SuSE-release')) { + $sysname = 'linuxredhat9'; } } Test script: --------------- <? // include class require ("Net/Ping.php"); // create object $ping = Net_Ping::factory(); $ping->setArgs(array("timeout" => 1, "count" => 1)); // ping host and display response if(!PEAR::isError($ping)) { $response = $ping->ping('10.97.252.52'); print_r($response); } print "Ping object:\n"; print "Received: " . $response->_received . "\n"; if(!$response->_received) { print "test2\n"; } ?>

Comments

 [2007-12-11 18:50 UTC] cconstantine (Craig Constantine)
Thank you for the submission. I will look at this asap.
 [2007-12-28 04:32 UTC] cconstantine (Craig Constantine)
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.