本文整理汇总了PHP中Host::add_user方法的典型用法代码示例。如果您正苦于以下问题:PHP Host::add_user方法的具体用法?PHP Host::add_user怎么用?PHP Host::add_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host::add_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: User
$user = new User();
$host = new Host($user);
$app = new App("upper_case");
$app_version = new App_Version($app);
$project->add_user($user);
$project->add_app($app);
$project->add_app_version($app_version);
$project->start_feeder = true;
$project->start_make_work = true;
$project->start_validate = true;
$project->start_file_delete = true;
$project->start_assimilator = true;
$project->install();
// must install projects before adding to hosts
$host->log_flags = "log_flags.xml";
$host->add_user($user, $project);
$host->install();
echo "adding work\n";
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->redundancy = 3;
array_push($work->input_files, "input");
$work->install($project);
$project->start_feeder();
$project->start_make_work($work);
$project->start_validate($app, 3);
$project->start_file_delete();
$project->start_assimilator($app);
$project->start_stripchart();
//$project->start_servers();
示例2:
$project1->shmem_key = "0x12344321";
$project1->short_name = "Project1";
$project1->long_name = "Project1";
$project1->add_user($user);
$project1->install();
// must install projects before adding to hosts
$project1->install_feeder();
$project2->resource_share = 5;
$project2->shmem_key = "0x12345678";
$project2->short_name = "Project2";
$project2->long_name = "Project2";
$project2->add_user($user);
$project2->install();
// must install projects before adding to hosts
$project2->install_feeder();
$host->add_user($user, $project1);
$host->add_user($user, $project2);
$host->install();
$work->install($project1);
$work->install($project2);
$project1->start_servers();
$project2->start_servers();
$host->run("-exit_when_idle -skip_cpu_benchmarks");
$project1->stop(1);
$project2->stop();
$result->server_state = RESULT_SERVER_STATE_OVER;
$project1->check_results(5, $result);
$project1->compare_file("uc_wu_0_0", "uc_correct_output");
$project1->compare_file("uc_wu_1_0", "uc_correct_output");
$project1->compare_file("uc_wu_2_0", "uc_correct_output");
$project1->compare_file("uc_wu_3_0", "uc_correct_output");