本文整理汇总了PHP中Build::withRunAndMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Build::withRunAndMode方法的具体用法?PHP Build::withRunAndMode怎么用?PHP Build::withRunAndMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Build
的用法示例。
在下文中一共展示了Build::withRunAndMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findSortOrder
private static function findSortOrder($run, $mode_id, $revision)
{
$version_control = VersionControl::forMode($mode_id);
$j = 0;
while (True) {
if ($j++ > 30) {
throw new Exception("There shouldn't be too many runs in between");
}
if (!$run->isBuildInfoComplete()) {
throw new Exception("Encountered an incomplete run.");
}
$build = Build::withRunAndMode($run->id, $mode_id);
// We can safely ignore runs that have no results with the requested mode_id
if (!$build) {
$run = $run->next();
continue;
}
// We skip to the next run, if revisions are the same.
// To make sure that new runs are shown after existing ones.
if ($version_control->equal($build->revision(), $revision)) {
$run = $run->next();
continue;
}
// Using version control take a peek if the revision
// is later/earlier than this one.
if ($version_control->isAfter($build->revision(), $revision)) {
return $run->sort_order();
}
$run = $run->next();
}
}
示例2: inbetweenBuilds
static function inbetweenBuilds($regression)
{
$build = $regression->build();
$run = $build->run();
$mode_id = $build->mode_id();
$machine_id = $run->machine_id();
$sortOrder = $run->sort_order();
$prevSortOrder = $regression->prev_build()->run()->sort_order();
$builds = array();
for ($i = $prevSortOrder + 1; $i < $sortOrder; $i++) {
$run_i = Run::withMachineAndSortOrder($machine_id, $i);
if (!$run_i->isFinished()) {
continue;
}
$build = Build::withRunAndMode($run_i->id, $mode_id);
if (!$build) {
continue;
}
if (count($build->scores()) == 0) {
continue;
}
$builds[] = $build;
}
return $builds;
}
示例3: GET_string
}
$error = GET_string('error');
$run->finish($status, $error);
die;
}
if (GET_string("run") == 'addEngine') {
$run = new Run(GET_int('runid'));
$revision = GET_string('cset');
$mode = Mode::FromMode(GET_string('name'));
if ($run->isFinished() || $run->hasError()) {
throw new Exception("Run was already finished or error'ed");
}
if ($run->isOutOfOrder()) {
// out of order builds cannot add extra modes. The available
// mode have already been added.
if (!Build::withRunAndMode($run->id, $mode->id)) {
$run->finish(0, "Tried to add extra modes to out of order run.");
}
die;
}
Build::insert($run, $mode->id, $revision);
die;
}
// Report that a slave is still awake when there are no benchmarks results
// to send.
if (GET_string('awake') == 'yes') {
$MACHINE = GET_int('MACHINE');
mysql_query("UPDATE awfy_machine\n SET last_checked = UNIX_TIMESTAMP()\n WHERE id = {$MACHINE}") or die("ERROR: " . mysql_error());
die;
}
// Report score of a benchmark total or subtest.