summaryrefslogtreecommitdiffstats
path: root/pts-core/functions/pts-functions_modules.php
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-09-30 21:56:29 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-09-30 21:56:29 -0400
commitfaa95aca968c56d73b3843fa71d9f7f6d5233a1d (patch)
tree1dc5c6141a9d181d53e9a06bb590f8d1616f0fb2 /pts-core/functions/pts-functions_modules.php
parent47f6c52a071e8f3f3320f34e79d34b4112289b3c (diff)
downloadphoronix-test-suite-upstream-faa95aca968c56d73b3843fa71d9f7f6d5233a1d.tar.gz
phoronix-test-suite-upstream-faa95aca968c56d73b3843fa71d9f7f6d5233a1d.tar.xz
phoronix-test-suite-upstream-faa95aca968c56d73b3843fa71d9f7f6d5233a1d.zip
pts-core: Clean-up SH module calls by using the new pts_sh_module_call()
Diffstat (limited to 'pts-core/functions/pts-functions_modules.php')
-rw-r--r--pts-core/functions/pts-functions_modules.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/pts-core/functions/pts-functions_modules.php b/pts-core/functions/pts-functions_modules.php
index d0d3c9d..a8b932c 100644
--- a/pts-core/functions/pts-functions_modules.php
+++ b/pts-core/functions/pts-functions_modules.php
@@ -154,6 +154,13 @@ function pts_module_processes()
return array("__startup", "__pre_install_process", "__pre_test_install", "__post_test_install", "__post_install_process",
"__pre_run_process", "__pre_test_run", "__interim_test_run", "__post_test_run", "__post_run_process", "__shutdown");
}
+function pts_sh_module_call($module, $process)
+{
+ $module_file = MODULE_DIR . $module . ".sh";
+
+ if(is_file($module_file))
+ return trim(shell_exec("sh " . $module_file . " " . $process . " 2>&1"));
+}
function pts_module_process($process)
{
// Run a module process on all registered modules
@@ -165,7 +172,7 @@ function pts_module_process($process)
if(pts_module_type($module) == "PHP")
eval("\$MODULE_RESPONSE = " . $module . "::" . $process . "();"); // TODO: This can be cleaned up once PHP 5.3.0+ is out there and adopted
else
- shell_exec("sh " . MODULE_DIR . $module . ".sh " . $process);
+ pts_sh_module_call($module, $process);
if(!empty($MODULE_RESPONSE))
{