[Phpsysinfo-subversion] SF.net SVN: phpsysinfo:[286] includes/mb
Brought to you by:
namiltd
From: <big...@us...> - 2009-06-26 07:06:37
|
Revision: 286 http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=286&view=rev Author: bigmichi1 Date: 2009-06-26 07:06:35 +0000 (Fri, 26 Jun 2009) Log Message: ----------- Fixed Bug [ 2811367 ] xml.php: prints warning in output Modified Paths: -------------- ChangeLog includes/mb/class.LMSensors.inc.php Modified: ChangeLog =================================================================== --- ChangeLog 2009-06-26 06:40:27 UTC (rev 285) +++ ChangeLog 2009-06-26 07:06:35 UTC (rev 286) @@ -5,6 +5,7 @@ - [FIX] Fixed Bug [ 2803964 ] Disabling language or template picklist fails - [FIX] Fixed Bug [ 2803480 ] Empty page when hddtemp enabled - [FIX] Fixed Bug [ 2804624 ] typos in config.php.new + - [FIX] Fixed Bug [ 2811367 ] xml.php: prints warning in output - [ADD] Added FR [ 2804580 ] Memory Usage Display - [ADD] Added FR [ 2784341 ] Multi core CPU load Modified: includes/mb/class.LMSensors.inc.php =================================================================== --- includes/mb/class.LMSensors.inc.php 2009-06-26 06:40:27 UTC (rev 285) +++ includes/mb/class.LMSensors.inc.php 2009-06-26 07:06:35 UTC (rev 286) @@ -40,7 +40,6 @@ parent::__construct(); switch (strtolower(PSI_SENSOR_ACCESS)) { case 'command': - $lines = ""; if (CommonFunctions::executeProgram("sensors", "", $lines)) { // Martijn Stolk: Dirty fix for misinterpreted output of sensors, // where info could come on next line when the label is too long. @@ -49,6 +48,13 @@ $this->_lines = explode("\n", $lines); } break; + case 'file': + if (CommonFunctions::rfts(APP_ROOT.'/data/lmsensors.txt', $lines)) { + $lines = str_replace(":\n", ":", $lines); + $lines = str_replace("\n\n", "\n", $lines); + $this->_lines = explode("\n", $lines); + } + break; default: $this->error->addConfigError('__construct()', 'PSI_SENSOR_ACCESS'); break; @@ -63,9 +69,8 @@ private function _temperature() { $ar_buf = array(); - $data = array(); foreach ($this->_lines as $line) { - unset($data); + $data = array(); if (ereg("(.*):(.*)\((.*)=(.*),(.*)=(.*)\)(.*)", $line, $data)) { ; } elseif (ereg("(.*):(.*)\((.*)=(.*)\)(.*)", $line, $data)) { @@ -83,7 +88,7 @@ } } foreach ($ar_buf as $line) { - unset($data); + $data = array(); if (ereg("(.*):(.*).C[ ]*\((.*)=(.*).C,(.*)=(.*).C\)(.*)\)", $line, $data)) { ; } elseif (ereg("(.*):(.*).C[ ]*\((.*)=(.*).C,(.*)=(.*).C\)(.*)", $line, $data)) { @@ -129,9 +134,8 @@ private function _fans() { $ar_buf = array(); - $data = array(); foreach ($this->_lines as $line) { - unset($data); + $data = array(); if (ereg("(.*):(.*)\((.*)=(.*),(.*)=(.*)\)(.*)", $line, $data)) { ; } elseif (ereg("(.*):(.*)\((.*)=(.*)\)(.*)", $line, $data)) { @@ -153,7 +157,7 @@ } } foreach ($ar_buf as $line) { - unset($data); + $data = array(); if (ereg("(.*):(.*) RPM \((.*)=(.*) RPM,(.*)=(.*)\)(.*)\)", $line, $data)) { ; } elseif (ereg("(.*):(.*) RPM \((.*)=(.*) RPM,(.*)=(.*)\)(.*)", $line, $data)) { @@ -181,9 +185,8 @@ private function _voltage() { $ar_buf = array(); - $data = array(); foreach ($this->_lines as $line) { - unset($data); + $data = array(); if (ereg("(.*):(.*)\((.*)=(.*),(.*)=(.*)\)(.*)", $line, $data)) { ; } else { @@ -203,7 +206,7 @@ } } foreach ($ar_buf as $line) { - unset($data); + $data = array(); if (ereg("(.*):(.*) V \((.*)=(.*) V,(.*)=(.*) V\)(.*)\)", $line, $data)) { ; } elseif (ereg("(.*):(.*) V \((.*)=(.*) V,(.*)=(.*) V\)(.*)", $line, $data)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |