summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-11-15 10:36:32 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-11-15 10:36:32 -0500
commitf39ef6f147abace725f966792f2fc27ab1094760 (patch)
tree4df323cd439e9cc742d9616b4d177f9c6610ce39
parentef295a3bb23a29dafaaedccdd4a7de8135182873 (diff)
downloadphoronix-test-suite-upstream-f39ef6f147abace725f966792f2fc27ab1094760.tar.gz
phoronix-test-suite-upstream-f39ef6f147abace725f966792f2fc27ab1094760.tar.xz
phoronix-test-suite-upstream-f39ef6f147abace725f966792f2fc27ab1094760.zip
pts-core: Add __pre_option_process() and __post_option_process() to PTS
module system
-rw-r--r--TYDAL-CHANGE-LOG1
-rw-r--r--pts-core/functions/pts-functions.php2
-rw-r--r--pts-core/functions/pts-functions_modules.php2
-rw-r--r--pts-core/objects/pts_module_interface.php14
-rw-r--r--pts-core/phoronix-test-suite.php6
5 files changed, 18 insertions, 7 deletions
diff --git a/TYDAL-CHANGE-LOG b/TYDAL-CHANGE-LOG
index 5d2f8e6..cda647b 100644
--- a/TYDAL-CHANGE-LOG
+++ b/TYDAL-CHANGE-LOG
@@ -25,3 +25,4 @@ Phoronix Test Suite (Git)
- pts-core: Switch a few global variables to static
- pts-core: Unify the XSL for the PTS Results Viewer and use a PHP function to insert the respective PNG/SVG markup when saving the results
- pts-core: Add pts_run_option_command() for modularizing executing PTS tasks
+- pts-core: Add __pre_option_process() and __post_option_process() to PTS module system
diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index 84e232d..23fcfc7 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -90,7 +90,9 @@ function pts_run_option_command($command, $pass_args = null, $command_descriptor
include_once("pts-core/options/" . $command . ".php");
}
+ pts_module_process("__pre_option_process", $command);
eval($command . "::run(\$pass_args);");
+ pts_module_process("__post_option_process", $command);
}
}
function p_str($str_o)
diff --git a/pts-core/functions/pts-functions_modules.php b/pts-core/functions/pts-functions_modules.php
index 1d2d716..4763abd 100644
--- a/pts-core/functions/pts-functions_modules.php
+++ b/pts-core/functions/pts-functions_modules.php
@@ -26,7 +26,7 @@
define("PTS_MODULE_UNLOAD", "PTS_MODULE_UNLOAD");
define("PTS_QUIT", "PTS_QUIT");
-function pts_module_start_process()
+function pts_module_startup_init()
{
// Process initially called when PTS starts up
$GLOBALS["PTS_MODULES"] = array();
diff --git a/pts-core/objects/pts_module_interface.php b/pts-core/objects/pts_module_interface.php
index e2a2551..c50061b 100644
--- a/pts-core/objects/pts_module_interface.php
+++ b/pts-core/objects/pts_module_interface.php
@@ -53,6 +53,19 @@ class pts_module_interface
}
//
+ // Option Functions
+ //
+
+ public static function __pre_option_process($obj = null)
+ {
+ return;
+ }
+ public static function __post_option_process($obj = null)
+ {
+ return;
+ }
+
+ //
// Installation Functions
//
@@ -111,7 +124,6 @@ class pts_module_interface
// Event-driven Functions
//
-
public static function __event_global_upload($obj = null)
{
// Passed is a string of the URL for the test results uploaded to Phoronix Global
diff --git a/pts-core/phoronix-test-suite.php b/pts-core/phoronix-test-suite.php
index 6b14eea..aecb2d5 100644
--- a/pts-core/phoronix-test-suite.php
+++ b/pts-core/phoronix-test-suite.php
@@ -33,11 +33,7 @@ if(pts_process_active("phoronix-test-suite"))
pts_process_register("phoronix-test-suite");
register_shutdown_function("pts_shutdown");
-// Module start process
-if(function_exists("pts_module_start_process"))
-{
- pts_module_start_process();
-}
+pts_module_startup_init(); // Initialize the PTS module system
// Etc
$PTS_GLOBAL_ID = 1;