Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Williams2016-01-23 17:43:26 +0000
committerDavid Williams2016-01-23 17:43:26 +0000
commitb83a059e8d25576b9f1007098357c7cb9a564dab (patch)
treeef614fa9b46a9358cadffe869aa8482fab64addc /production/downloadsites
parent8ac328576b10d76ed0e33db0774bc3b2970c94f0 (diff)
downloadeclipse.platform.releng.aggregator-b83a059e8d25576b9f1007098357c7cb9a564dab.tar.gz
eclipse.platform.releng.aggregator-b83a059e8d25576b9f1007098357c7cb9a564dab.tar.xz
eclipse.platform.releng.aggregator-b83a059e8d25576b9f1007098357c7cb9a564dab.zip
bug 486418 minor fixes and cleanup of Equinox DL site
Diffstat (limited to 'production/downloadsites')
-rw-r--r--production/downloadsites/equinox/index.php166
1 files changed, 90 insertions, 76 deletions
diff --git a/production/downloadsites/equinox/index.php b/production/downloadsites/equinox/index.php
index 1f25c4c6e..18cf19467 100644
--- a/production/downloadsites/equinox/index.php
+++ b/production/downloadsites/equinox/index.php
@@ -14,70 +14,82 @@ $pageKeywords = "equinox, osgi, framework, runtime, download";
$pageAuthor = "Equinox committers";
include('dlconfig.php');
+#echo ("DOCUMENT_ROOT: " . $_SERVER['DOCUMENT_ROOT']."<br/>");
$aDirectory = dir("drops");
while ($anEntry = $aDirectory->read()) {
- // Short cut because we know aDirectory only contains other directories.
-
- if ($anEntry != "." && $anEntry!=".." && $anEntry!="TIME") {
- // do not count hidden directories in computation
- // allows non-hidden ones to still show up as "most recent" else will be blank.
- if (!file_exists("drops/".$anEntry."/buildHidden")) {
- $parts = explode("-", $anEntry);
- if (count($parts) == 3) {
-
- //$buckets[$parts[0]][] = $anEntry;
-
- $timePart = $parts[2];
- $year = substr($timePart, 0, 4);
- $month = substr($timePart, 4, 2);
- $day = substr($timePart, 6, 2);
- $hour = substr($timePart,8,2);
- $minute = substr($timePart,10,2);
- // special logic adds 1 second if build id contains "RC" ... this was
- // added for the M build case, where there is an M build and and RC version that
- // have same time stamp. One second should not effect displayed values.
- $isRC = strpos($anEntry, "RC");
- if ($isRC === false) {
- $timeStamp = mktime($hour, $minute, 0, $month, $day, $year);
- } else {
- $timeStamp = mktime($hour, $minute, 1, $month, $day, $year);
- }
- $buckets[$parts[0]][$timeStamp] = $anEntry;
- $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp);
- if ($timeStamp > $latestTimeStamp[$parts[0]]) {
- $latestTimeStamp[$parts[0]] = $timeStamp;
- $latestFile[$parts[0]] = $anEntry;
- }
+ // Short cut because we know aDirectory only contains other directories.
+
+ if ($anEntry != "." && $anEntry!=".." && $anEntry!="TIME") {
+ // do not count hidden directories in computation
+ // allows non-hidden ones to still show up as "most recent" else will be blank.
+ if (!file_exists("drops/".$anEntry."/buildHidden")) {
+ $parts = explode("-", $anEntry);
+ if (count($parts) == 3) {
+
+ //$buckets[$parts[0]][] = $anEntry;
+
+ $timePart = $parts[2];
+ $year = substr($timePart, 0, 4);
+ $month = substr($timePart, 4, 2);
+ $day = substr($timePart, 6, 2);
+ $hour = substr($timePart,8,2);
+ $minute = substr($timePart,10,2);
+ // special logic adds 1 second if build id contains "RC" ... this was
+ // added for the M build case, where there is an M build and and RC version that
+ // have same time stamp. One second should not effect displayed values.
+ $isRC = strpos($anEntry, "RC");
+ if ($isRC === false) {
+ $timeStamp = mktime($hour, $minute, 0, $month, $day, $year);
+ } else {
+ $timeStamp = mktime($hour, $minute, 1, $month, $day, $year);
}
+ $buckets[$parts[0]][$timeStamp] = $anEntry;
+ $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp);
+ if (isset($latestTimeStamp) && array_key_exists($parts[0], $latestTimeStamp)) {
+ if ($timeStamp > $latestTimeStamp[$parts[0]]) {
+ $latestTimeStamp[$parts[0]] = $timeStamp;
+ $latestFile[$parts[0]] = $anEntry;
+ }
+ } else {
+ $latestTimeStamp[$parts[0]] = $timeStamp;
+ $latestFile[$parts[0]] = $anEntry;
+ }
+
+ }
- if (count($parts) == 2) {
- $buildType=substr($parts[0],0,1);
- //$buckets[$buildType][] = $anEntry;
- $datePart = substr($parts[0],1);
- $timePart = $parts[1];
- $year = substr($datePart, 0, 4);
- $month = substr($datePart, 4, 2);
- $day = substr($datePart, 6, 2);
- $hour = substr($timePart,0,2);
- $minute = substr($timePart,2,2);
- $isRC = strpos($anEntry, "RC");
- if ($isRC === false) {
- $timeStamp = mktime($hour, $minute, 0, $month, $day, $year);
- } else {
- $timeStamp = mktime($hour, $minute, 1, $month, $day, $year);
- }
- $buckets[$buildType[0]][$timeStamp] = $anEntry;
-
- $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp);
- if ($timeStamp > $latestTimeStamp[$buildType]) {
- $latestTimeStamp[$buildType] = $timeStamp;
- $latestFile[$buildType] = $anEntry;
- }
+ if (count($parts) == 2) {
+ $buildType=substr($parts[0],0,1);
+ //$buckets[$buildType][] = $anEntry;
+ $datePart = substr($parts[0],1);
+ $timePart = $parts[1];
+ $year = substr($datePart, 0, 4);
+ $month = substr($datePart, 4, 2);
+ $day = substr($datePart, 6, 2);
+ $hour = substr($timePart,0,2);
+ $minute = substr($timePart,2,2);
+ $isRC = strpos($anEntry, "RC");
+ if ($isRC === false) {
+ $timeStamp = mktime($hour, $minute, 0, $month, $day, $year);
+ } else {
+ $timeStamp = mktime($hour, $minute, 1, $month, $day, $year);
+ }
+ $buckets[$buildType[0]][$timeStamp] = $anEntry;
+
+ $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp);
+ if (isset($latestTimeStamp) && array_key_exists($buildType,$latestTimeStamp)) {
+ if ($timeStamp > $latestTimeStamp[$buildType]) {
+ $latestTimeStamp[$buildType] = $timeStamp;
+ $latestFile[$buildType] = $anEntry;
+ }
+ } else {
+ $latestTimeStamp[$buildType] = $timeStamp;
+ $latestFile[$buildType] = $anEntry;
}
}
}
+ }
}
$html = <<<EOHTML
@@ -92,7 +104,8 @@ $html = <<<EOHTML
EOHTML;
foreach($dropType as $value) {
- $prefix=$typeToPrefix[$value];
+ $prefix=$typeToPrefix[$value];
+ if (array_key_exists($prefix, $latestFile)) {
$fileName = $latestFile[$prefix];
$parts = explode("-", $fileName);
@@ -101,13 +114,13 @@ foreach($dropType as $value) {
// Comment the line below if we need click through licenses.
if (count($parts)==3)
- $html .= <<<EOHTML
+ $html .= <<<EOHTML
<tr>
<td width="30%"><a href="drops/$fileName/index.php">$parts[1]</a></td>
EOHTML;
if (count($parts)==2)
- $html .= <<<EOHTML
+ $html .= <<<EOHTML
<tr>
<td width="30%"><a href="drops/$fileName/index.php">$fileName</a></td>
@@ -119,55 +132,56 @@ EOHTML;
</tr>
EOHTML;
+ }
}
-
$html .= <<<EOHTML
</table>
EOHTML;
foreach($dropType as $value) {
- $prefix=$typeToPrefix[$value];
+ $prefix=$typeToPrefix[$value];
- $html .= <<<EOHTML
+ $html .= <<<EOHTML
<h3>$value Builds</h3>
<table width="100%" CELLSPACING=0 CELLPADDING=3>
EOHTML;
-
+ if (array_key_exists($prefix,$buckets)) {
$aBucket = $buckets[$prefix];
if (isset($aBucket)) {
- krsort($aBucket);
- foreach($aBucket as $innerValue) {
- $parts = explode("-", $innerValue);
- $html .= <<<EOHTML
+ krsort($aBucket);
+ foreach($aBucket as $innerValue) {
+ $parts = explode("-", $innerValue);
+ $html .= <<<EOHTML
<tr>
EOHTML;
- // Uncomment the line below if we need click through licenses.
- // echo "<td><a href=\"license.php?license=drops/$innerValue\">$parts[1]</a></td>";
+ // Uncomment the line below if we need click through licenses.
+ // echo "<td><a href=\"license.php?license=drops/$innerValue\">$parts[1]</a></td>";
- // Comment the line below if we need click through licenses.
- if (count ($parts)==3)
- $html .= <<<EOHTML
+ // Comment the line below if we need click through licenses.
+ if (count ($parts)==3)
+ $html .= <<<EOHTML
<td width="30%"><a href="drops/$innerValue/index.php">$parts[1]</a></td>
EOHTML;
- if (count ($parts)==2)
- $html .= <<<EOHTML
+ if (count ($parts)==2)
+ $html .= <<<EOHTML
<td width="30%"><a href="drops/$innerValue/index.php">$innerValue</a></td>
EOHTML;
- $html .= <<<EOHTML
+ $html .= <<<EOHTML
<td>$timeStamps[$innerValue]</td>
</tr>
EOHTML;
- }
+ }
}
- $html .= <<<EOHTML
+ }
+ $html .= <<<EOHTML
</table>
EOHTML;

Back to the top