本文整理汇总了PHP中pts_openbenchmarking::openbenchmarking_host方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_openbenchmarking::openbenchmarking_host方法的具体用法?PHP pts_openbenchmarking::openbenchmarking_host怎么用?PHP pts_openbenchmarking::openbenchmarking_host使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pts_openbenchmarking
的用法示例。
在下文中一共展示了pts_openbenchmarking::openbenchmarking_host方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upload_usage_data
public static function upload_usage_data($task, $data)
{
if (!pts_network::internet_support_available()) {
return false;
}
switch ($task) {
case 'test_install':
list($test_install, $time_elapsed) = $data;
$upload_data = array('test_identifier' => $test_install->test_profile->get_identifier(), 'test_version' => $test_install->test_profile->get_test_profile_version(), 'elapsed_time' => $time_elapsed);
pts_network::http_upload_via_post(pts_openbenchmarking::openbenchmarking_host() . 'extern/statistics/report-test-install.php', $upload_data);
break;
case 'test_complete':
list($test_result, $time_elapsed) = $data;
$upload_data = array('test_identifier' => $test_result->test_profile->get_identifier(), 'test_version' => $test_result->test_profile->get_test_profile_version(), 'elapsed_time' => $time_elapsed);
pts_network::http_upload_via_post(pts_openbenchmarking::openbenchmarking_host() . 'extern/statistics/report-test-completion.php', $upload_data);
break;
case 'test_install_failure':
list($test_install, $error) = $data;
$upload_data = array('test_identifier' => $test_install->test_profile->get_identifier(), 'error' => $error, 'os' => phodevi::read_property('system', 'vendor-identifier'));
pts_network::http_upload_via_post(pts_openbenchmarking::openbenchmarking_host() . 'extern/statistics/report-test-install-failure.php', $upload_data);
break;
}
}
示例2: make_openbenchmarking_request
public static function make_openbenchmarking_request($request, $post = array())
{
$url = pts_openbenchmarking::openbenchmarking_host() . 'f/client.php';
$to_post = array_merge(array('r' => $request, 'client_version' => PTS_CORE_VERSION, 'gsid' => defined('PTS_GSID') ? PTS_GSID : null, 'gsid_e' => defined('PTS_GSID_E') ? PTS_GSID_E : null), $post);
if (PTS_IS_CLIENT && ($account = pts_openbenchmarking_client::get_openbenchmarking_account()) && is_array($account)) {
$to_post = array_merge($to_post, $account);
}
return pts_network::http_upload_via_post($url, $to_post);
}