2006-08-04 21:39:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// show information about downloadable BOINC client software
|
|
|
|
//
|
|
|
|
// URL options:
|
|
|
|
// xml=1 Show results as XML (other options are ignored)
|
|
|
|
// dev=1 Show "development" versions
|
|
|
|
// min_version=x show no versions earlier than x
|
|
|
|
// max_version=x show no versions later than x
|
|
|
|
// version=x show version x
|
|
|
|
// platform=x show only versions for platform x (win/mac/linux/solaris)
|
|
|
|
|
|
|
|
require_once("docutil.php");
|
2009-10-30 16:08:13 +00:00
|
|
|
require_once("versions.inc");
|
2006-08-04 21:39:03 +00:00
|
|
|
|
2010-09-27 20:34:47 +00:00
|
|
|
$xml = get_str2("xml");
|
|
|
|
$dev = get_str2("dev");
|
|
|
|
$pname = get_str2("platform");
|
|
|
|
$min_version = get_str2("min_version");
|
|
|
|
$max_version = get_str2("max_version");
|
|
|
|
$version = get_str2("version");
|
|
|
|
$type_name = get_str2("type");
|
2009-10-30 16:08:13 +00:00
|
|
|
$client_info = $_SERVER['HTTP_USER_AGENT'];
|
2006-08-04 21:39:03 +00:00
|
|
|
|
2009-10-30 16:08:13 +00:00
|
|
|
if (!$xml) $dev=1;
|
2006-08-04 21:39:03 +00:00
|
|
|
|
|
|
|
function dl_item($x, $y) {
|
2008-10-22 15:49:01 +00:00
|
|
|
echo "<tr><td valign=top align=right width=\"30%\">$x</td>
|
2006-08-04 21:39:03 +00:00
|
|
|
<td>$y</td></tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2007-07-27 18:30:10 +00:00
|
|
|
function version_url($v) {
|
2006-08-04 21:39:03 +00:00
|
|
|
global $url_base;
|
2007-07-27 18:30:10 +00:00
|
|
|
$file = $v["file"];
|
|
|
|
if (is_dev($v)) {
|
|
|
|
return "http://boinc.berkeley.edu/dl/$file";
|
|
|
|
} else {
|
|
|
|
return $url_base.$file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_detail($v) {
|
2006-08-04 21:39:03 +00:00
|
|
|
$num = $v["num"];
|
|
|
|
$file = $v["file"];
|
|
|
|
$status = $v["status"];
|
|
|
|
$path = "dl/$file";
|
2007-07-27 18:30:10 +00:00
|
|
|
$url = version_url($v);
|
2006-08-04 21:39:03 +00:00
|
|
|
$dlink = "<a href=$url>$file</a>";
|
|
|
|
$s = number_format(filesize($path)/1000000, 2);
|
|
|
|
$date = $v["date"];
|
|
|
|
$type = type_text($v["type"]);
|
|
|
|
|
|
|
|
list_start();
|
|
|
|
dl_item("File (click to download)", "$dlink ($s MB)");
|
|
|
|
dl_item("Version number", $num);
|
|
|
|
dl_item("Release date", $date);
|
|
|
|
list_end();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function show_version_xml($v, $p) {
|
|
|
|
$name = $p["name"];
|
|
|
|
$dbname = $p["dbname"];
|
|
|
|
$num = $v["num"];
|
|
|
|
$file = $v["file"];
|
|
|
|
$status = $v["status"];
|
|
|
|
$path = "dl/$file";
|
2007-07-27 18:30:10 +00:00
|
|
|
$url = version_url($v);
|
2006-08-04 21:39:03 +00:00
|
|
|
$dlink = "<a href=$url>$file</a>";
|
|
|
|
$s = number_format(filesize($path)/1000000, 2);
|
|
|
|
$date = $v["date"];
|
|
|
|
$type = type_text($v["type"]);
|
|
|
|
echo "
|
|
|
|
<version>
|
|
|
|
<platform>$name</platform>
|
|
|
|
<dbplatform>$dbname</dbplatform>
|
|
|
|
<description>$status</description>
|
|
|
|
<date>$date</date>
|
|
|
|
<version_num>$num</version_num>
|
|
|
|
<url>$url</url>
|
|
|
|
<filename>$file</filename>
|
|
|
|
<size_mb>$s</size_mb>
|
|
|
|
<installer>$type</installer>
|
|
|
|
</version>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_version($pname, $i, $v) {
|
2013-07-29 05:42:18 +00:00
|
|
|
if (!$v) return;
|
2006-08-04 21:39:03 +00:00
|
|
|
$num = $v["num"];
|
|
|
|
$file = $v["file"];
|
|
|
|
$status = $v["status"];
|
|
|
|
if (is_dev($v)) {
|
|
|
|
$status = $status."
|
2008-10-22 15:49:01 +00:00
|
|
|
<br><span class=dev>
|
2006-08-04 21:39:03 +00:00
|
|
|
(MAY BE UNSTABLE - USE ONLY FOR TESTING)
|
2008-10-22 15:49:01 +00:00
|
|
|
</span>
|
2006-08-04 21:39:03 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
$path = "dl/$file";
|
|
|
|
$s = number_format(filesize($path)/1000000, 2);
|
2007-09-17 16:19:58 +00:00
|
|
|
$date = $v["date"];
|
2006-08-04 21:39:03 +00:00
|
|
|
$type = $v["type"];
|
|
|
|
$type_text = type_text($type);
|
2007-07-27 18:30:10 +00:00
|
|
|
$url = version_url($v);
|
2008-10-22 04:29:19 +00:00
|
|
|
echo "<tr>
|
2008-12-16 21:33:33 +00:00
|
|
|
<td class=rowlineleft>$num</td>
|
|
|
|
<td class=rowline>$status</td>
|
|
|
|
<td class=rowline><a href=\"$url\"><b>Download</b></a> ($s MB)</td>
|
|
|
|
<td class=rowlineright>$date</td>
|
2006-08-04 21:39:03 +00:00
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_platform($short_name, $p, $dev) {
|
|
|
|
global $min_version;
|
|
|
|
global $max_version;
|
|
|
|
$long_name = $p["name"];
|
2008-01-28 15:48:09 +00:00
|
|
|
$description = $p["description"];
|
2011-07-22 22:47:41 +00:00
|
|
|
if (array_key_exists('url', $p)) {
|
2006-08-04 21:39:03 +00:00
|
|
|
$url = $p["url"];
|
2008-10-22 04:29:19 +00:00
|
|
|
$long_name .= " <a href=$url><span class=description>details</span></a>";
|
2006-08-04 21:39:03 +00:00
|
|
|
}
|
2008-01-28 15:48:09 +00:00
|
|
|
list_bar($long_name, $description);
|
2006-08-04 21:39:03 +00:00
|
|
|
foreach ($p["versions"] as $i=>$v) {
|
2008-01-07 23:33:48 +00:00
|
|
|
if ($min_version && version_compare($v['num'], $min_version, "<")) continue;
|
|
|
|
if ($max_version && version_compare($v['num'], $max_version, ">")) continue;
|
2006-08-04 21:39:03 +00:00
|
|
|
if (!$dev && is_dev($v)) continue;
|
|
|
|
show_version($short_name, $i, $v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_platform_xml($short_name, $p, $dev) {
|
|
|
|
foreach ($p["versions"] as $i=>$v) {
|
|
|
|
if (!$dev && is_dev($v)) continue;
|
2008-09-30 16:57:07 +00:00
|
|
|
// show only those builds that have been around for over three days.
|
|
|
|
// Gives us time to address any showstoppers
|
2008-08-24 16:19:28 +00:00
|
|
|
// found by the early adopters
|
2008-09-30 16:57:07 +00:00
|
|
|
if (!$dev && ((time() - strtotime($v["date"])) <= 86400*3)) continue;
|
2006-08-04 21:39:03 +00:00
|
|
|
show_version_xml($v, $p);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// show details on a version if URL indicates
|
|
|
|
//
|
|
|
|
if ($pname && $version) {
|
|
|
|
$p = $platforms[$pname];
|
|
|
|
if (!$p) {
|
2009-12-18 04:32:30 +00:00
|
|
|
boinc_error_page("platform not found");
|
2006-08-04 21:39:03 +00:00
|
|
|
}
|
|
|
|
$long_name = $p["name"];
|
|
|
|
$va = $p["versions"];
|
|
|
|
foreach ($va as $v) {
|
|
|
|
if ($v['num'] == $version && $type_name==$v['type']) {
|
|
|
|
page_head("BOINC version $version for $long_name");
|
|
|
|
show_detail($v);
|
|
|
|
page_tail();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
}
|
2009-12-18 04:32:30 +00:00
|
|
|
boinc_error_page( "version not found\n");
|
2006-08-04 21:39:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($xml) {
|
|
|
|
header('Content-type: text/xml');
|
2008-08-24 16:20:52 +00:00
|
|
|
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n
|
|
|
|
<versions>\n
|
2006-08-04 21:39:03 +00:00
|
|
|
";
|
2009-10-30 16:08:13 +00:00
|
|
|
if (FALSE === strpos($client_info, '6.8.')) {
|
|
|
|
foreach($platforms as $short_name=>$p) {
|
|
|
|
show_platform_xml($short_name, $p, $dev);
|
|
|
|
}
|
2006-08-04 21:39:03 +00:00
|
|
|
}
|
2008-08-24 16:20:52 +00:00
|
|
|
echo "
|
|
|
|
</versions>\n
|
|
|
|
";
|
2006-08-04 21:39:03 +00:00
|
|
|
} else {
|
|
|
|
if ($pname) {
|
|
|
|
$p = $platforms[$pname];
|
|
|
|
$name = $p['name'];
|
|
|
|
page_head("Download BOINC client software for $name");
|
2008-10-22 15:49:01 +00:00
|
|
|
echo "<table width=\"100%\" cellpadding=4 >";
|
2006-08-04 21:39:03 +00:00
|
|
|
show_platform($pname, $p, $dev);
|
|
|
|
list_end();
|
|
|
|
} else {
|
|
|
|
page_head("Download BOINC client software");
|
|
|
|
echo "
|
2008-10-22 15:49:01 +00:00
|
|
|
<table width=\"100%\" cellpadding=4 >
|
2006-08-04 21:39:03 +00:00
|
|
|
";
|
|
|
|
foreach($platforms as $short_name=>$p) {
|
|
|
|
show_platform($short_name, $p, $dev);
|
|
|
|
}
|
|
|
|
list_end();
|
|
|
|
echo "
|
2008-04-01 15:08:47 +00:00
|
|
|
<h3>Other platforms</h3>
|
2006-08-04 21:39:03 +00:00
|
|
|
If your computer is not of one of these types, you can
|
|
|
|
<ul>
|
2011-02-08 21:38:16 +00:00
|
|
|
<li> <a href=\"wiki/Anonymous_platform\">make your own client software</a> or
|
2008-10-22 15:49:01 +00:00
|
|
|
<li> <a href=\"trac/wiki/DownloadOther\">download executables from a third-party site</a>
|
2006-08-04 21:39:03 +00:00
|
|
|
(available for Solaris/Opteron, Linux/Opteron, Linux/PPC, HP-UX, and FreeBSD, and others).
|
|
|
|
</ul>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
echo "
|
2011-11-16 19:47:40 +00:00
|
|
|
<hr size=1>
|
2008-04-01 15:08:47 +00:00
|
|
|
The information on this page can be
|
2008-10-22 15:49:01 +00:00
|
|
|
<a href=\"trac/wiki/DownloadInfo\">
|
2008-04-01 15:08:47 +00:00
|
|
|
restricted by platform and/or version number,
|
|
|
|
or presented in XML format</a>.
|
2006-08-04 21:39:03 +00:00
|
|
|
";
|
|
|
|
page_tail();
|
|
|
|
}
|
|
|
|
|
2008-10-22 04:29:19 +00:00
|
|
|
?>
|