Skip to main content
summaryrefslogtreecommitdiffstats
blob: 03b8aae91edeabae2923153fb0b110bf6f52e269 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<html>
<head>
<title>Eclipse Download Click Through</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="http://download.eclipse/eclipse/default_style.css" type="text/css">
<?php

$servername=$_SERVER['SERVER_NAME'];

$script = $_SERVER['SCRIPT_NAME'];
$patharray = pathinfo($_SERVER['SCRIPT_NAME']);
$path = $patharray['dirname'];
$buildDir = array_pop(split("/",$path,-1));
$qstring = $_SERVER['QUERY_STRING'];
$dropFile=array_pop(split("=",$qstring,-1));

if ($qstring) {
  $url = "http://$servername$script?$qstring";
} else {
  $url = "http://$servername$path$script";
}

$dropdir = explode("/", getcwd());
$parts2 = explode("-", $dropdir[count($dropdir) - 1]);
if ($parts2[1]) {
  $buildName = $parts2[0] . "-" .$parts2[1];
} else {
  $buildName = $parts2[1];
}

$mirror=true;
if (strstr($_SERVER['SERVER_NAME'],"eclipse.org")) {
  #       if (strstr($_SERVER['SERVER_NAME'],"ibm.com")) {
  $mirror=false;
  $eclipselink="http://www.eclipse.org/downloads/download.php?file=/equinox/drops/$buildDir/$dropFile";
} else {
  $mirrorlink  = "http://$servername$path/$dropFile";
}

$clickFile = "clickThroughs/";
$clickFileName = str_replace("-$buildName","",$dropFile);
$clickFile = $clickFile.$clickFileName.".txt";

if (file_exists($clickFile)) {
  $fileHandle = fopen($clickFile, "r");
  while (!feof($fileHandle)) {
    $aLine = fgets($fileHandle, 4096);
    $result = $result.$aLine;
  }
  fclose($fileHandle);
} else {
  if ($mirror) {
    echo '<META HTTP-EQUIV="Refresh" CONTENT="0;URL='.$dropFile.'">';
    echo '<b><font size "+4">Downloading: '.$mirrorlink.'</font></b>';
  } else {
    echo '<META HTTP-EQUIV="Refresh" CONTENT="0;URL='.$eclipselink.'">';
    echo '<b><font size "+4">Downloading: '.$eclipselink.'</font></b>';
  }
  echo '<BR>';
  echo '<BR>';
  if ($mirror) {
    echo 'If your download does not begin automatically click <a href='.$dropFile.'>here</a>.';
  } else {
    echo 'If your download does not begin automatically click <a href='.$eclipselink.'>here</a>.';
  }
}
?>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php
if (file_exists($clickFile)) {
  echo '<p><b><font size="+4">Important Notes<BR>';
  echo '</font></b></font></p>
    <p>It is very important to read the following notes in order to run this version
    of Eclipse. Once you have read the notes you can click on the Download link
    to download the drop.</p>
    ';
  echo '<textarea name="textfield" cols="80" rows="18" wrap="PHYSICAL">'.$result;
  echo '</textarea>';
  echo '<BR>';
  echo '<BR>';

  if ($mirror) {
    echo '<a href="'.$dropFile.'">Download</a>';
  } else {
    echo '<a href="'.$eclipselink.'">Download</a>';
  }
}
?>
</body>
</html>

Back to the top