本文整理汇总了PHP中pts_client::exit_client方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_client::exit_client方法的具体用法?PHP pts_client::exit_client怎么用?PHP pts_client::exit_client使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pts_client
的用法示例。
在下文中一共展示了pts_client::exit_client方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: module_process
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);
}
示例2: user_agreement_check
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)));
}
}