summaryrefslogtreecommitdiffstats
path: root/pts-core/functions/pts-functions_system_parsing.php
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-10-22 09:19:14 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-10-22 09:19:14 -0400
commit818ec8e8353ad5a29e3693c44dfc73af79573afc (patch)
treef932937ed181da06495b1fe33fa37188402d0413 /pts-core/functions/pts-functions_system_parsing.php
parentcd3302d2749cebf998c2a824f42ca0cc592ef957 (diff)
downloadphoronix-test-suite-upstream-818ec8e8353ad5a29e3693c44dfc73af79573afc.tar.gz
phoronix-test-suite-upstream-818ec8e8353ad5a29e3693c44dfc73af79573afc.tar.xz
phoronix-test-suite-upstream-818ec8e8353ad5a29e3693c44dfc73af79573afc.zip
pts-core: More read_dmidecode() parsing tweaks
Diffstat (limited to 'pts-core/functions/pts-functions_system_parsing.php')
-rw-r--r--pts-core/functions/pts-functions_system_parsing.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/pts-core/functions/pts-functions_system_parsing.php b/pts-core/functions/pts-functions_system_parsing.php
index ddb6a80..e256d82 100644
--- a/pts-core/functions/pts-functions_system_parsing.php
+++ b/pts-core/functions/pts-functions_system_parsing.php
@@ -646,13 +646,16 @@ function read_osx_system_profiler($data_type, $object)
return $value;
}
-function read_dmidecode($type, $sub_type, $object, $find_once = false)
+function read_dmidecode($type, $sub_type, $object, $find_once = false, $ignore = null)
{
// Read Linux dmidecode
$value = array();
if(is_readable("/dev/mem"))
{
+ if(!is_array($ignore))
+ $ignore = array($ignore);
+
$dmidecode = shell_exec("dmidecode --type " . $type . " 2>&1");
$sub_type = "\n" . $sub_type . "\n";
@@ -672,7 +675,7 @@ function read_dmidecode($type, $sub_type, $object, $find_once = false)
{
$dmidecode_r = explode(":", $dmidecode_elements[$i]);
- if(trim($dmidecode_r[0]) == $object && isset($dmidecode_r[1]))
+ if(trim($dmidecode_r[0]) == $object && isset($dmidecode_r[1]) && !in_array(trim($dmidecode_r[1]), $ignore))
{
array_push($value, trim($dmidecode_r[1]));
$found_in_section = true;