read())) { // Short cut because we know aDirectory only contains other directories. if ($anEntry != "." && $anEntry!="..") { // echo "Debug anEntry: $anEntry
" ; $aDropDirectoryName = "drops/".$buildBranch."/".$anEntry; if (is_dir($aDropDirectoryName) && is_Readable($aDropDirectoryName)) { $aDropDirectory = dir($aDropDirectoryName); //echo "Debug aDropDirectory: $aDropDirectory->path
" ; $fileCount = 0; while ($aDropEntry = $aDropDirectory->read()) { // echo "Debug aDropEntry: $aDropEntry
" ; if ( (stristr($aDropEntry, ".tar.gz")) || (stristr($aDropEntry, ".zip")) ) { // Count the dropfile entry in the directory (so we won't display links, if not all there $fileCount = $fileCount + 1; } } $aDropDirectory->close(); } // Read the count file $countFile = "drops/".$buildBranch."/".$anEntry."/files.count"; $indexFile = "drops/".$buildBranch."/".$anEntry."/index.html"; if (!file_exists($indexFile)) { $indexFile = "drops/".$buildBranch."/".$anEntry."/index.php"; } if (file_exists($countFile) && file_exists($indexFile)) { $anArray = file($countFile); // debug //echo "Number according to files.count: ", $anArray[0]; //echo " actual counted files: ", $fileCount; // If a match - process the directoryVV -- we simply look that there's more // zip's than we expect, since it frequently breaks where the count is slighly // off, such as when we add, after the fact, an all-in-one zip. if ($anArray[0] <= $fileCount) { // debug //echo "yes, counted equaled expected count
"; $entryParts = explode("-", $anEntry); if (count($entryParts) == 3) { // debug //echo "yes, counted parts was 3
"; $buildTypePart = $entryParts[0]; $buckets[$buildBranch][$buildTypePart][] = $anEntry; if ($debugScript) { echo "Found: $buildBranch, $buildTypePart, $anEntry
"; } $timePart = $entryParts[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); $newTimePart = "$year-$month-$day $hour:$minute UTC"; $timeStamp = strtotime($newTimePart); $timeStamps[$anEntry] = gmdate("D, j M Y -- H:i \(\U\T\C\)", $timeStamp); // debug // echo "
buildBranch: $buildBranch
"; // echo "
parts[0]: -$buildTypePart-
"; // echo "latestTimeStamp[buildBranch]:"; // echo $latestTimeStamp[$buildBranch]; // echo "latestTimeStamp:"; // echo $latestTimeStamp; if ((sizeof($latestTimeStamp[$buildBranch]) > 0) && (isset($latestTimeStamp[$buildBranch][$buildTypePart]))) { if ($timeStamp > $latestTimeStamp[$buildBranch][$buildTypePart]) { $latestTimeStamp[$buildBranch][$buildTypePart] = $timeStamp; $latestFile[$buildBranch][$buildTypePart] = $anEntry; } } else { $latestTimeStamp[$buildBranch][$buildTypePart] = $timeStamp; $latestFile[$buildBranch][$buildTypePart] = $anEntry; } } } } } } $aDirectory->close(); }} } ?>