@@ 42-50 (lines=9) @@ | ||
39 | { |
|
40 | parent::__construct(); |
|
41 | switch (defined('PSI_SENSOR_LMSENSORS_ACCESS')?strtolower(PSI_SENSOR_LMSENSORS_ACCESS):'command') { |
|
42 | case 'command': |
|
43 | if (CommonFunctions::executeProgram("sensors", "", $lines)) { |
|
44 | // Martijn Stolk: Dirty fix for misinterpreted output of sensors, |
|
45 | // where info could come on next line when the label is too long. |
|
46 | $lines = str_replace(":\n", ":", $lines); |
|
47 | $lines = str_replace("\n\n", "\n", $lines); |
|
48 | $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
|
49 | } |
|
50 | break; |
|
51 | case 'data': |
|
52 | if (CommonFunctions::rfts(APP_ROOT.'/data/lmsensors.txt', $lines)) { |
|
53 | $lines = str_replace(":\n", ":", $lines); |
|
@@ 51-57 (lines=7) @@ | ||
48 | $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
|
49 | } |
|
50 | break; |
|
51 | case 'data': |
|
52 | if (CommonFunctions::rfts(APP_ROOT.'/data/lmsensors.txt', $lines)) { |
|
53 | $lines = str_replace(":\n", ":", $lines); |
|
54 | $lines = str_replace("\n\n", "\n", $lines); |
|
55 | $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
|
56 | } |
|
57 | break; |
|
58 | default: |
|
59 | $this->error->addConfigError('__construct()', 'PSI_SENSOR_LMSENSORS_ACCESS'); |
|
60 | break; |