diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-10-21 14:49:13 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-10-21 14:49:13 -0400 |
commit | 2d3dc4f983bbf077432cff8193836038584b369c (patch) | |
tree | 4df666081826593634cb525cea030302d19dddf9 /pts-core/functions/pts-functions_system_parsing.php | |
parent | 139577a6d076e528d4ee77674a2ab20570d1dc1f (diff) | |
download | phoronix-test-suite-upstream-2d3dc4f983bbf077432cff8193836038584b369c.tar.gz phoronix-test-suite-upstream-2d3dc4f983bbf077432cff8193836038584b369c.tar.xz phoronix-test-suite-upstream-2d3dc4f983bbf077432cff8193836038584b369c.zip |
pts-core: Add Linux support for reading DIMM speed, capacity, and bank
information through DMI
Diffstat (limited to 'pts-core/functions/pts-functions_system_parsing.php')
-rw-r--r-- | pts-core/functions/pts-functions_system_parsing.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pts-core/functions/pts-functions_system_parsing.php b/pts-core/functions/pts-functions_system_parsing.php index 0d245f1..ddb6a80 100644 --- a/pts-core/functions/pts-functions_system_parsing.php +++ b/pts-core/functions/pts-functions_system_parsing.php @@ -667,13 +667,15 @@ function read_dmidecode($type, $sub_type, $object, $find_once = false) $dmidecode = substr($dmidecode, strlen($dmidecode_section)); $dmidecode_elements = explode("\n", $dmidecode_section); - for($i = 0; $i < count($dmidecode_elements) && ($find_once == false || $value == false); $i++) + $found_in_section = false; + for($i = 0; $i < count($dmidecode_elements) && $found_in_section == false; $i++) { $dmidecode_r = explode(":", $dmidecode_elements[$i]); if(trim($dmidecode_r[0]) == $object && isset($dmidecode_r[1])) { array_push($value, trim($dmidecode_r[1])); + $found_in_section = true; } } } @@ -685,7 +687,7 @@ function read_dmidecode($type, $sub_type, $object, $find_once = false) { $value = false; } - else if($fine_once != false && count($value) == 1) + else if($find_once != false && count($value) == 1) { $value = $value[0]; } |