本文整理汇总了PHP中pts_client::display方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_client::display方法的具体用法?PHP pts_client::display怎么用?PHP pts_client::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pts_client
的用法示例。
在下文中一共展示了pts_client::display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init_display_mode
public static function init_display_mode($override_display_mode = false)
{
if (PTS_IS_WEB_CLIENT && !defined('PHOROMATIC_SERVER')) {
self::$display = new pts_web_display_mode();
return;
}
$env_mode = pts_client::is_debug_mode() ? 'BASIC' : $override_display_mode;
switch ($env_mode != false || ($env_mode = pts_client::read_env('PTS_DISPLAY_MODE')) != false ? $env_mode : pts_config::read_user_config('PhoronixTestSuite/Options/General/DefaultDisplayMode', 'DEFAULT')) {
case 'BASIC':
self::$display = new pts_basic_display_mode();
break;
case 'BATCH':
case 'CONCISE':
self::$display = new pts_concise_display_mode();
break;
case 'SHORT':
self::$display = new pts_short_display_mode();
break;
case 'DEFAULT':
default:
self::$display = new pts_concise_display_mode();
break;
}
}
示例2: run_benchmark
public function run_benchmark($user, $args)
{
$json_queue = json_decode(base64_decode($args), true);
$json['pts']['msg']['name'] = 'run_benchmark_queue';
if (!isset($json_queue['tests']) || count($json_queue['tests']) == 0) {
$json['pts']['msg']['error'] = 'No tests in the queue.';
} else {
if (!isset($json_queue['title']) || $json_queue['title'] == null) {
$json['pts']['msg']['error'] = 'No test title/name provided.';
} else {
if (!isset($json_queue['identifier']) || $json_queue['identifier'] == null) {
$json['pts']['msg']['error'] = 'No test identifier provided.';
} else {
$json['pts']['msg']['go'] = 'Benchmarking.';
}
}
}
$this->send_json_data($user->socket, $json);
if (isset($json['pts']['msg']['error']) && $json['pts']['msg']['error'] != null) {
exit(1);
}
pts_client::$display = new pts_websocket_display_mode();
pts_client::$display->set_web_socket($this, $user->id);
$virtual_test_queue = array();
$virtual_test_queue[0] = new pts_virtual_test_queue();
foreach ($json_queue['tests'] as $test) {
$virtual_test_queue[0]->add_to_queue($test['test_profile_id'], $test['test_options_title'], $test['test_options_value']);
}
$test_run_manager = new pts_test_run_manager(false, true);
pts_test_installer::standard_install($virtual_test_queue, false, true);
if ($test_run_manager->initial_checks($virtual_test_queue) == false) {
$j['pts']['msg']['name'] = 'benchmark_state';
$j['pts']['msg']['current_state'] = 'failed';
$j['pts']['msg']['error'] = 'Failed to install test.';
$this->send_json_data($user->socket, $j);
exit(1);
}
if ($test_run_manager->load_tests_to_run($virtual_test_queue)) {
// SETUP
$test_run_manager->auto_upload_to_openbenchmarking();
pts_openbenchmarking_client::override_client_setting('UploadSystemLogsByDefault', true);
$test_run_manager->auto_save_results($json_queue['title'], $json_queue['identifier'], $json_queue['description'], true);
// BENCHMARK
$test_run_manager->pre_execution_process();
$test_run_manager->call_test_runs();
$test_run_manager->post_execution_process();
$j['pts']['msg']['name'] = 'benchmark_state';
$j['pts']['msg']['current_state'] = 'complete';
$j['pts']['msg']['result_title'] = $test_run_manager->get_title();
$j['pts']['msg']['result_file_name'] = $test_run_manager->get_file_name();
$j['pts']['msg']['result_identifier'] = $test_run_manager->get_results_identifier();
$j['pts']['msg']['result_url'] = $test_run_manager->get_results_url();
$this->send_json_data($user->socket, $j);
}
// exit(0);
}