<?php header("Content-type: text/xml"); ?> <plugin-repository> <ff>mbeddr</ff> <category name="mbeddr"> <?php /** * */ $build = isset($_GET['build']) ? $_GET['build'] : "MPS-143.795"; $requiredMpsVersion = getVersionFromBuild($build); $dir = './'; processMPSVersionFolders($dir, $requiredMpsVersion); function processMPSVersionFolders($basePath, $requiredMpsVersion) { $versionedPath = $basePath . $requiredMpsVersion . '/'; if (file_exists($versionedPath)) { processPluginVersionFolders($versionedPath, $requiredMpsVersion); } } function processPluginVersionFolders($folder, $requiredMpsVersion) { $newest = getNewestVersion(scandir($folder)); if ($newest != "") { processPluginsFolder($folder . $newest . "/", $requiredMpsVersion, $newest); } } function getNewestVersion($folders)
function updowndata($buildSearched, $component = null, $caseIDarg = null) { $version = getVersionFromBuild($buildSearched); // get up/down data for a build if ($component == null) { $arrData = createDataForUpDown($buildSearched); } elseif ($component != null) { $arrData = createDataForUpDownComponent($buildSearched, $component); } elseif ($caseID != null) { $arrData = createDataForUpDownCase($buildSearched, $caseIDarg); } if (!is_array($arrData)) { return "not_array"; } // extract searched build data $buildData = array(); foreach ($arrData as $release => $releaseData) { foreach ($releaseData[builds] as $buildNum => $build) { if ($buildNum == $buildSearched) { $buildData = $build; break; } } } // create results array $moduleArr = array(); foreach ($buildData[rel] as $versionFull => $release) { $relID = getVersionIDFromVersionFull($versionFull); if (!is_array($moduleArr[$relID][categories])) { $moduleArr[$relID][categories] = array(); } foreach ($release[cases] as $caseID => $case) { if (!is_array($moduleArr[$relID][categories][$case[category]])) { $moduleArr[$relID][categories][$case[category]] = array(); if (!is_array($moduleArr[$relID][categories][$case[category]][modules][$case[component]])) { $moduleArr[$relID][categories][$case[category]][modules][$case[component]] = array(); } } $moduleArr[$relID][categories][$case[category]][modules][$case[component]][cases][$caseID] = $case; } } foreach ($moduleArr as $relID => $rel) { $modNames = array(); $catNames = array(); $pass = $fail = $time = 0; foreach ($rel[categories] as $catName => $category) { array_push($catNames, "'" . $catName . "'"); $passC = $failC = $timeC = 0; foreach ($category[modules] as $modName => $module) { array_push($modNames, "'" . $modName . "'"); $passM = $failM = $timeM = 0; foreach ($module[cases] as $caseID => $case) { $timeC += $case[time]; $timeM += $case[time]; $time += $case[time]; if (!($case[time] > 0)) { $case[time] = 1; } $moduleArr[$relID][categories][$catName][modules][$modName][cases][$caseID][time] = date("i:s", mktime(0, 0, $case[time])); if ($case[status] == "PASSED") { $passM++; } elseif ($case[status] != "RUNNING") { $failM++; } } //email if ($failM == 0) { $moduleArr[$relID][categories][$catName][modules][$modName][email] = 0; } else { $moduleArr[$relID][categories][$catName][modules][$modName][email] = 1; } if ($gren == "grenreg") { $moduleArr[$relID][categories][$catName][modules][$modName][stats] = createTPFtableGren($passM, $failM, $version, $buildSearched, $modName, $catName, "yes"); $moduleArr[$relID][categories][$catName][modules][$modName][chart] = createBarChartForGrenReg($passM + $failM, $passM, $failM, $buildSearched, $version, $modName, $catName, "yes"); } else { $moduleArr[$relID][categories][$catName][modules][$modName][stats] = createTPFtableUpDown($relID, $passM, $failM, $version, $buildSearched, $modName, $catName, "yes"); $moduleArr[$relID][categories][$catName][modules][$modName][chart] = createBarChartForRegression2($passM + $failM, $passM, $failM, $buildSearched, $version, $modName, $catName, "yes"); } $moduleArr[$relID][categories][$catName][modules][$modName][time] = Sec2Time($timeM); $commentData = getModuleCommentsUpDown($modName, $catName, $buildSearched, $version, $relID); $ownerData = getModuleOwners($modName); $moduleArr[$relID][categories][$catName][modules][$modName][sqaOwner] = $ownerData[sqa]; $moduleArr[$relID][categories][$catName][modules][$modName][devOwner] = $ownerData[dev]; $moduleArr[$relID][categories][$catName][modules][$modName][autOwner] = $ownerData[auto]; if (is_array($commentData)) { $moduleArr[$relID][categories][$catName][modules][$modName][comment] = $commentData[comment]; $moduleArr[$relID][categories][$catName][modules][$modName][bugLink] = createModuleBugField($commentData[bugs]); $moduleArr[$relID][categories][$catName][modules][$modName][bugs] = $commentData[bugs]; } $passC += $passM; $failC += $failM; } $moduleArr[$relID][categories][$catName][stats] = createTPFtable2($passC, $failC, $version, $buildSearched, "", $catName, ""); $moduleArr[$relID][categories][$catName][chart] = createBarChartForRegression2($passC + $failC, $passC, $failC, $buildSearched, $version, $modName, $catName, ""); $moduleArr[$relID][categories][$catName][time] = Sec2Time($timeC); $pass += $passC; $fail += $failC; } $moduleArr[$relID][stats] = createTPFtable2($pass, $fail, $version, $buildSearched, "", "", ""); $moduleArr[$relID][chart] = createBarChartForRegression2($pass + $fail, $pass, $fail, $buildSearched, $version, $modName, $catName, ""); $moduleArr[$relID][time] = Sec2Time($time); $moduleArr[$relID][modNames] = implode(",", array_unique($modNames)); $moduleArr[$relID][catNames] = implode(",", array_unique($catNames)); $moduleArr[$relID][fullname] = getVersionFullFromVersionID($relID); } // sort category / component names in alphabetical order $relNames = array(); foreach ($moduleArr as $relID => $rel) { // store updown release names array_push($relNames, $relID); ksort($moduleArr[$relID][categories], SORT_STRING); foreach ($rel[categories] as $catName => $module) { ksort($rel[categories][$catName][modules], SORT_STRING); } } $result = array(); array_push($result, $moduleArr); array_push($result, implode(",", $relNames)); return $result; }