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 13:41 UTC Modified: 2007-12-27 23:32 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  


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