* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
- Adding SM2 panel [SME: 13004] - Upgrade to phpsysinfo 3.4.4 - Add code to delete inline styles and add css to make it look better. - version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
@@ -1,26 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* hddtemp sensor class
|
||||
* hddtemp sensor class, getting information from hddtemp
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Sensor
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.hddtemp.inc.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* getting information from hddtemp
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Sensor
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @author T.A. van Roermund <timo@van-roermund.nl>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
@@ -30,16 +19,16 @@ class HDDTemp extends Sensors
|
||||
* get the temperature information from hddtemp
|
||||
* access is available through tcp or command
|
||||
*
|
||||
* @return array temperatures in array
|
||||
* @return void
|
||||
*/
|
||||
private function _temperature()
|
||||
{
|
||||
$ar_buf = array();
|
||||
switch (strtolower(PSI_HDD_TEMP)) {
|
||||
case "tcp":
|
||||
if ((PSI_OS == 'Linux') && (!defined('PSI_EMU_HOSTNAME') || defined('PSI_EMU_PORT'))) switch (defined('PSI_SENSOR_HDDTEMP_ACCESS')?strtolower(PSI_SENSOR_HDDTEMP_ACCESS):'command') {
|
||||
case 'tcp':
|
||||
$lines = '';
|
||||
// Timo van Roermund: connect to the hddtemp daemon, use a 5 second timeout.
|
||||
$fp = @fsockopen('localhost', 7634, $errno, $errstr, 5);
|
||||
$fp = @fsockopen(defined('PSI_EMU_HOSTNAME')?PSI_EMU_HOSTNAME:'localhost', 7634, $errno, $errstr, 5);
|
||||
// if connected, read the output of the hddtemp daemon
|
||||
if ($fp) {
|
||||
while (!feof($fp)) {
|
||||
@@ -52,7 +41,7 @@ class HDDTemp extends Sensors
|
||||
$lines = str_replace("||", "|\n|", $lines);
|
||||
$ar_buf = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
|
||||
break;
|
||||
case "command":
|
||||
case 'command':
|
||||
$strDrives = "";
|
||||
$strContent = "";
|
||||
$hddtemp_value = "";
|
||||
@@ -100,8 +89,7 @@ class HDDTemp extends Sensors
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->error->addConfigError("temperature()", "PSI_HDD_TEMP");
|
||||
break;
|
||||
$this->error->addConfigError("temperature()", "[sensor_hddtemp] ACCESS");
|
||||
}
|
||||
// Timo van Roermund: parse the info from the hddtemp daemon.
|
||||
foreach ($ar_buf as $line) {
|
||||
@@ -114,7 +102,7 @@ class HDDTemp extends Sensors
|
||||
if (is_numeric($data[3])) {
|
||||
$dev->setValue($data[3]);
|
||||
}
|
||||
$dev->setMax(60);
|
||||
// $dev->setMax(60);
|
||||
$this->mbinfo->setMbTemp($dev);
|
||||
}
|
||||
}
|
||||
@@ -126,7 +114,7 @@ class HDDTemp extends Sensors
|
||||
*
|
||||
* @see PSI_Interface_Sensor::build()
|
||||
*
|
||||
* @return Void
|
||||
* @return void
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
|
Reference in New Issue
Block a user