diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-06-07 23:06:08 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-06-07 23:06:08 -0400 |
commit | fe4804789791da17d40413373d56ab71466ad4f7 (patch) | |
tree | 902d786cd3aa86166a8fd94c06ca34e498288b60 /pts-core/functions/pts-functions_modules.php | |
parent | 8a32a92dc66680e3a8aa7929e0d44b8b4edbf909 (diff) | |
download | phoronix-test-suite-upstream-fe4804789791da17d40413373d56ab71466ad4f7.tar.gz phoronix-test-suite-upstream-fe4804789791da17d40413373d56ab71466ad4f7.tar.xz phoronix-test-suite-upstream-fe4804789791da17d40413373d56ab71466ad4f7.zip |
Start to push forward some Phoronix Test Suite modules / plug-in
framework support... Some basic bits are now in there but nothing to
keep end-users, yet.
Diffstat (limited to 'pts-core/functions/pts-functions_modules.php')
-rw-r--r-- | pts-core/functions/pts-functions_modules.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/pts-core/functions/pts-functions_modules.php b/pts-core/functions/pts-functions_modules.php new file mode 100644 index 0000000..c351320 --- /dev/null +++ b/pts-core/functions/pts-functions_modules.php @@ -0,0 +1,32 @@ +<?php + +/* + Phoronix Test Suite "Trondheim" + URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/ + Copyright (C) 2008, Phoronix Media + Copyright (C) 2008, Michael Larabel + pts-functions_modules.php: Functions related to PTS module loading/management. + Modules are optional add-ons that don't fit the requirements for entrance into pts-core but provide added functionality. +*/ + +function pts_load_modules(&$modules_list) +{ + // TODO: Detect other modules to load + + // Clean-up modules list + array_unique($modules_list); + for($i = 0; $i < count($modules_list); $i++) + if(!is_file(MODULE_DIR . $modules_list[$i] . ".php")) + unset($modules_list[$i]); + + // Load the modules + foreach($modules_list as $module) + include(MODULE_DIR . $module . ".php"); +} +function pts_module_process($process) +{ + foreach($GLOBALS["PTS_MODULES"] as $module) + eval("$module::$process();"); // TODO: This can be cleaned up once PHP 5.3.0+ is out there and adopted +} + +?> |