public static function module_process($process, &$object_pass = null, $select_modules = false) { // Run a module process on all registered modules foreach (pts_module_manager::attached_modules($process, $select_modules) as $module) { pts_module_manager::set_current_module($module); $module_response = pts_module_manager::module_call($module, $process, $object_pass); switch ($module_response) { case pts_module::MODULE_UNLOAD: // Unload the PTS module pts_module_manager::detach_module($module); break; case pts_module::QUIT_PTS_CLIENT: // Stop the Phoronix Test Suite immediately pts_client::exit_client(); break; } } pts_module_manager::set_current_module(null); }
public static function user_agreement_check($command) { $pso = pts_storage_object::recover_from_file(PTS_CORE_STORAGE); if ($pso == false) { return false; } $config_md5 = $pso->read_object('user_agreement_cs'); $current_md5 = md5_file(PTS_PATH . 'pts-core/user-agreement.txt'); if (($config_md5 != $current_md5 || pts_config::read_user_config('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting', 'UNKNOWN') == 'UNKNOWN') && !PTS_IS_DAEMONIZED_SERVER_PROCESS && getenv('PTS_SILENT_MODE') != 1 && $config_md5 != 'enterprise-agree') { $prompt_in_method = pts_client::check_command_for_function($command, 'pts_user_agreement_prompt'); $user_agreement = file_get_contents(PTS_PATH . 'pts-core/user-agreement.txt'); if ($prompt_in_method) { $user_agreement_return = call_user_func(array($command, 'pts_user_agreement_prompt'), $user_agreement); if (is_array($user_agreement_return)) { if (count($user_agreement_return) == 3) { list($agree, $usage_reporting) = $user_agreement_return; } else { $agree = array_shift($user_agreement_return); $usage_reporting = -1; } } else { $agree = $user_agreement_return; $usage_reporting = -1; } } if ($prompt_in_method == false || $usage_reporting == -1) { pts_client::$display->generic_heading('User Agreement'); echo wordwrap($user_agreement, 65); $agree = pts_user_io::prompt_bool_input('Do you agree to these terms and wish to proceed', true); $usage_reporting = $agree ? pts_user_io::prompt_bool_input('Enable anonymous usage / statistics reporting', true) : -1; } if ($agree) { echo PHP_EOL; $pso->add_object('user_agreement_cs', $current_md5); $pso->save_to_file(PTS_CORE_STORAGE); } else { pts_client::exit_client('In order to run the Phoronix Test Suite, you must agree to the listed terms.'); } pts_config::user_config_generate(array('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting' => pts_config::bool_to_string($usage_reporting))); } }