當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Build::GetCurrentBuildId方法代碼示例

本文整理匯總了PHP中Build::GetCurrentBuildId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Build::GetCurrentBuildId方法的具體用法?PHP Build::GetCurrentBuildId怎麽用?PHP Build::GetCurrentBuildId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Build的用法示例。


在下文中一共展示了Build::GetCurrentBuildId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: echo_main_dashboard_JSON


//.........這裏部分代碼省略.........
    }
    list($previousdate, $currentstarttime, $nextdate) = get_dates($date, $project_array['nightlytime']);
    // Main dashboard section
    get_dashboard_JSON($projectname, $date, $response);
    $response['displaylabels'] = $project_array['displaylabels'];
    $page_id = 'index.php';
    $response['childview'] = 0;
    if ($CDASH_USE_LOCAL_DIRECTORY && file_exists('local/models/proProject.php')) {
        include_once 'local/models/proProject.php';
        $pro = new proProject();
        $pro->ProjectId = $projectid;
        $response['proedition'] = $pro->GetEdition(1);
    }
    if ($currentstarttime > time() && !isset($_GET['parentid'])) {
        $response['error'] = 'CDash cannot predict the future (yet)';
        echo json_encode($response);
        return;
    }
    // Menu definition
    $response['menu'] = array();
    $beginning_timestamp = $currentstarttime;
    $end_timestamp = $currentstarttime + 3600 * 24;
    $beginning_UTCDate = gmdate(FMT_DATETIME, $beginning_timestamp);
    $end_UTCDate = gmdate(FMT_DATETIME, $end_timestamp);
    if ($project_instance->GetNumberOfSubProjects($end_UTCDate) > 0) {
        $response['menu']['subprojects'] = 1;
    }
    if (isset($_GET['parentid'])) {
        $page_id = 'indexchildren.php';
        $response['childview'] = 1;
        // When a parentid is specified, we should link to the next build,
        // not the next day.
        $previous_buildid = $parent_build->GetPreviousBuildId();
        $current_buildid = $parent_build->GetCurrentBuildId();
        $next_buildid = $parent_build->GetNextBuildId();
        $base_url = 'index.php?project=' . urlencode($projectname);
        if ($previous_buildid > 0) {
            $response['menu']['previous'] = "{$base_url}&parentid={$previous_buildid}";
        } else {
            $response['menu']['noprevious'] = '1';
        }
        $response['menu']['current'] = "{$base_url}&parentid={$current_buildid}";
        if ($next_buildid > 0) {
            $response['menu']['next'] = "{$base_url}&parentid={$next_buildid}";
        } else {
            $response['menu']['nonext'] = '1';
        }
    } elseif (!has_next_date($date, $currentstarttime)) {
        $response['menu']['nonext'] = 1;
    }
    // Check if a SubProject parameter was specified.
    $subproject_name = @$_GET['subproject'];
    $subprojectid = false;
    if ($subproject_name) {
        $SubProject = new SubProject();
        $subproject_name = htmlspecialchars(pdo_real_escape_string($subproject_name));
        $SubProject->SetName($subproject_name);
        $SubProject->SetProjectId($projectid);
        $subprojectid = $SubProject->GetId();
        if ($subprojectid) {
            // Add an extra URL argument for the menu
            $response['extraurl'] = '&subproject=' . urlencode($subproject_name);
            $response['subprojectname'] = $subproject_name;
            $subproject_response = array();
            $subproject_response['name'] = $SubProject->GetName();
            $dependencies = $SubProject->GetDependencies();
開發者ID:kitware,項目名稱:cdash,代碼行數:67,代碼來源:index.php

示例2: qnum

$starttime = $build_array['starttime'];
$threshold = $project_array['coveragethreshold'];
if ($build_array['groupid'] > 0) {
    $row = pdo_single_row_query('SELECT coveragethreshold FROM subprojectgroup
     WHERE projectid=' . qnum($projectid) . '
     AND id=' . qnum($build_array['groupid']));
    if (!empty($row) && isset($row['coveragethreshold'])) {
        $threshold = $row['coveragethreshold'];
    }
}
$xml .= '<menu>';
$xml .= add_XML_value('back', 'index.php?project=' . urlencode($projectname) . '&date=' . get_dashboard_date_from_build_starttime($build_array['starttime'], $project_array['nightlytime']));
$build = new Build();
$build->Id = $buildid;
$previous_buildid = $build->GetPreviousBuildId();
$current_buildid = $build->GetCurrentBuildId();
$next_buildid = $build->GetNextBuildId();
if ($previous_buildid > 0) {
    $xml .= add_XML_value('previous', 'viewCoverage.php?buildid=' . $previous_buildid);
} else {
    $xml .= add_XML_value('noprevious', '1');
}
$xml .= add_XML_value('current', "viewCoverage.php?buildid={$current_buildid}");
if ($next_buildid > 0) {
    $xml .= add_XML_value('next', "viewCoverage.php?buildid={$next_buildid}");
} else {
    $xml .= add_XML_value('nonext', '1');
}
$xml .= '</menu>';
$xml .= add_XML_value('filtercount', $filtercount);
if ($filtercount > 0) {
開發者ID:kitware,項目名稱:cdash,代碼行數:31,代碼來源:viewCoverage.php


注:本文中的Build::GetCurrentBuildId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。