summaryrefslogtreecommitdiffstats
path: root/pts-core/functions/pts-functions_system_parsing.php
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-11-13 10:48:01 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-11-13 10:48:01 -0500
commit8d65c91a513dcdd75778f0f0cf44834f7f59c530 (patch)
treecdc0b8375926a263496b2964304bf721fabd6cfd /pts-core/functions/pts-functions_system_parsing.php
parentc9fc2e016c9da1180a607a2d8788188dde429183 (diff)
downloadphoronix-test-suite-upstream-8d65c91a513dcdd75778f0f0cf44834f7f59c530.tar.gz
phoronix-test-suite-upstream-8d65c91a513dcdd75778f0f0cf44834f7f59c530.tar.xz
phoronix-test-suite-upstream-8d65c91a513dcdd75778f0f0cf44834f7f59c530.zip
pts-core: Add static/hal-remove-words.txt to contain a list of all HAL
strings to remove if found, instead of having it coded within an array
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, 6 insertions, 1 deletions
diff --git a/pts-core/functions/pts-functions_system_parsing.php b/pts-core/functions/pts-functions_system_parsing.php
index b4aab38..f9b5274 100644
--- a/pts-core/functions/pts-functions_system_parsing.php
+++ b/pts-core/functions/pts-functions_system_parsing.php
@@ -56,12 +56,18 @@ function read_acpi($point, $match)
function read_hal($name, $UDI = null)
{
// Read HAL - Hardware Abstraction Layer
+ static $remove_words = null;
$info = "Unknown";
if(!is_array($name))
{
$name = array($name);
}
+ if(empty($remove_words) && is_file(STATIC_DIR . "hal-remove-words.txt"))
+ {
+ $word_file = trim(file_get_contents(STATIC_DIR . "hal-remove-words.txt"));
+ $remove_words = array_map("trim", explode("\n", $word_file));
+ }
for($i = 0; $i < count($name) && $info == "Unknown"; $i++)
{
@@ -80,7 +86,6 @@ function read_hal($name, $UDI = null)
$info = trim(substr($info, 0, strpos($info, "'")));
}
- $remove_words = array("empty", "unknow", "system manufacturer", "system version", "system name", "system product name", "to be filled by o.e.m.", "not applicable", "not specified", "oem", "00", "none", "1234567890");
if(empty($info) || in_array(strtolower($info), $remove_words))
{
$info = "Unknown";