Skip to content

Commit

Permalink
[574646] Installer Auto Launch button template for GitHub
Browse files Browse the repository at this point in the history
https://bugs.eclipse.org/bugs/show_bug.cgi?id=574646

Server doesn't allow archives to be read, so use an unzipped cache.
  • Loading branch information
merks committed Jul 5, 2021
1 parent 06af7a4 commit 3d29572
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions releng/org.eclipse.oomph.releng/www/installer/fetch.php
Expand Up @@ -4,19 +4,16 @@
$url = $_GET["url"];
if (preg_match("@^https?://[^/]+eclipse.org/@i", $url) == FALSE) {
$path = str_replace("://", "/", $url);
$zip = new ZipArchive;
$res = $zip->open('../setups.zip');
if ($res === TRUE) {
$contents = $zip->getFromName($path);
if ($contents == "") {
$path = str_replace("http://", "https/", $url);
$contents = $zip->getFromName($path);
}
$zip->close();
echo $contents;
} else {
http_response_code(404);
$contents = @file_get_contents("../setups/$path");
if ($contents == "") {
$path = str_replace("http://", "https/", $url);
$contents = @file_get_contents("../setups/$path");
}
if ($contents == "") {
http_response_code(404);
} else {
echo $contents;
}
} else {
$contents = @file_get_contents($url);
if ($contents === FALSE) {
Expand All @@ -25,4 +22,4 @@
echo $contents;
}
}
?>
?>

0 comments on commit 3d29572

Please sign in to comment.