summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-07-16 10:40:57 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-08-03 11:49:20 -0400
commit06faa35d77c5e7f0375bcc5ce8c94e750a8ea6dd (patch)
tree208efd638a9a79f1d5e136d413215f40dfb6b45a
parent797eda058777aee486bbe53b69cf87cddcbfadc6 (diff)
downloadphoronix-test-suite-upstream-06faa35d77c5e7f0375bcc5ce8c94e750a8ea6dd.tar.gz
phoronix-test-suite-upstream-06faa35d77c5e7f0375bcc5ce8c94e750a8ea6dd.tar.xz
phoronix-test-suite-upstream-06faa35d77c5e7f0375bcc5ce8c94e750a8ea6dd.zip
pts-core: Move environmental variables to check for auto-loading of PTS
modules out to modules/module-variables.txt
-rw-r--r--PTS-12-CHANGE-LOG1
-rw-r--r--pts-core/functions/pts-functions_modules.php27
-rw-r--r--pts-core/modules/module-variables.txt5
3 files changed, 25 insertions, 8 deletions
diff --git a/PTS-12-CHANGE-LOG b/PTS-12-CHANGE-LOG
index fd11a6c..159bac5 100644
--- a/PTS-12-CHANGE-LOG
+++ b/PTS-12-CHANGE-LOG
@@ -31,6 +31,7 @@
- pts-core: If PromptForDownloadMirror tag in user-config.xml is set to TRUE, prompt the user when running in a non-batch mode what mirror to download a test file from or optionally the user can input their own download location
- pts-core: Drop (GNOME) screensaver toggling from the core, move to a module
- pts-core: Write PTS_BATCH_MODE=1 to Extensions tag in results file when PTS is running in batch mode
+- pts-core: Move environmental variables to check for auto-loading of PTS modules out to modules/module-variables.txt
- pts_module: If pcntl isn't present, don't thread and warn the user
- pts_module: Add a simple module called dummy_module for showing developers where the different functions are called
diff --git a/pts-core/functions/pts-functions_modules.php b/pts-core/functions/pts-functions_modules.php
index f309003..bc4954e 100644
--- a/pts-core/functions/pts-functions_modules.php
+++ b/pts-core/functions/pts-functions_modules.php
@@ -38,19 +38,30 @@ function pts_module_start_process()
}
function pts_auto_detect_modules($load_here = FALSE)
{
- $modules_assoc = array("MONITOR" => "system_monitor", "FORCE_AA" => "graphics_override", "FORCE_AF" => "graphics_override", "HALT_SCREENSAVER" => "toggle_screensaver", "EMAIL_RESULTS_TO" => "email_results");
+ $module_variables_file = @file_get_contents(MODULE_DIR . "module-variables.txt");
+ $module_variables = explode("\n", $module_variables_file);
- foreach($modules_assoc as $env_var => $module)
- if(!in_array($module, $GLOBALS["PTS_MODULES"]) && ($e = getenv($env_var)) != FALSE && !empty($e))
+ foreach($module_variables as $module_var)
+ {
+ $module_var = explode("=", $module_var);
+
+ if(count($module_var) == 2)
{
- if(defined("PTS_DEBUG_MODE"))
- echo "Attempting To Add Module: " . $module . "\n";
+ $env_var = trim($module_var[0]);
+ $module = trim($module_var[1]);
- array_push($GLOBALS["PTS_MODULES"], $module);
+ if(!in_array($module, $GLOBALS["PTS_MODULES"]) && ($e = getenv($env_var)) != FALSE && !empty($e))
+ {
+ if(defined("PTS_DEBUG_MODE"))
+ echo "Attempting To Add Module: " . $module . "\n";
- if($load_here)
- pts_load_module($module);
+ array_push($GLOBALS["PTS_MODULES"], $module);
+
+ if($load_here)
+ pts_load_module($module);
+ }
}
+ }
}
function pts_load_modules()
{
diff --git a/pts-core/modules/module-variables.txt b/pts-core/modules/module-variables.txt
new file mode 100644
index 0000000..1a6e930
--- /dev/null
+++ b/pts-core/modules/module-variables.txt
@@ -0,0 +1,5 @@
+MONITOR=system_monitor
+FORCE_AA=graphics_override
+FORCE_AF=graphics_override
+HALT_SCREENSAVER=toggle_screensaver
+EMAIL_RESULTS_TO=email_results