1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00
Files
archived-web-php/releases/index.php
Peter Kokot dd8d8bf863 Sync final and leading newlines
This patch adds some missing newlines, trims some multiple redundant
final newlines into a single one, and trims few redundant leading
newlines.

According to POSIX, a line is a sequence of zero or more non-'<newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-17 12:37:26 +02:00

240 lines
6.8 KiB
PHP

<?php
$_SERVER['BASE_PAGE'] = 'releases/index.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once $_SERVER["DOCUMENT_ROOT"] . "/include/branches.inc";
if (isset($_GET["serialize"]) || isset($_GET["json"])) {
$RELEASES[5][$PHP_5_6_VERSION]["date"] = $PHP_5_6_DATE;
$RELEASES = $RELEASES + $OLDRELEASES;
$machineReadable = array();
if (isset($_GET["version"])) {
$ver = (int)$_GET["version"];
if (isset($RELEASES[$ver])) {
list($version, $r) = each($RELEASES[$ver]);
if (isset($_GET["max"])) {
$max = (int)$_GET["max"];
if ($max == -1) { $max = PHP_INT_MAX; }
$machineReadable = array($version => $r);
$count = 1;
/* check if other $RELEASES[$ver] are there */
/* e.g., 5_3, 5_4, and 5_5 all exist and have a release */
while(($z = each($RELEASES[$ver])) && $count++ < $max) {
$machineReadable[$z[0]] = $z[1];
}
foreach($OLDRELEASES[$ver] as $version => $release) {
if ($max <= $count++) {
break;
}
$machineReadable[$version] = $release;
}
} else {
$r["version"] = $version;
$machineReadable = $r;
}
} else {
$machineReadable = array("error" => "Unknown version");
}
} else {
$machineReadable = array();
foreach($RELEASES as $major => $release) {
list($version, $r) = each($release);
$r["version"] = $version;
$machineReadable[$major] = $r;
}
}
if (isset($_GET["serialize"])) {
header('Content-type: text/plain');
echo serialize($machineReadable);
} elseif (isset($_GET["json"])) {
header('Content-Type: application/json');
echo json_encode($machineReadable);
}
return;
}
// Tarball list generated with:
// cvs status -v php[34]/INSTALL |grep 'php_'|awk '{print $1}'|grep -Ev '(RC[0-9]*|rc[_0-9]*|REL|[ab][a0-9-]+|b..rc.|b.pl.|bazaar|pre|[ab])$'|sed -e 's,php_,,' -e 's,_,.,g'|sort -n|while read ver; do echo " <option value=\"php-${ver}.tar.gz\">$ver</option>"; done
// Show the two most recent EOLed branches.
$eol = array();
foreach (get_eol_branches() as $major => $branches) {
foreach ($branches as $branch => $detail) {
$eol[$detail['date']] = sprintf('<li>%s: %s</li>', $branch, date('j M Y', $detail['date']));
}
}
krsort($eol);
$eol = implode('', array_slice($eol, 0, 2));
$SIDEBAR_DATA = '
<div class="panel">
<a class="headline" href="/supported-versions.php">Supported Versions</a>
<div class="body">
Check the <a href="/supported-versions.php">supported versions</a> page for
more information on the support lifetime of each version of PHP.
</div>
</div>
<div class="panel">
<a class="headline" href="/eol.php">End of Life Dates</a>
<div class="body">
<p>The most recent branches to reach end of life status are:</p>
<ul>'.$eol.'</ul>
</div>
</div>
<p class="panel">
<a href="/ChangeLog-7.php">PHP 7 ChangeLog</a>
</p>
<p class="panel">
<a href="/ChangeLog-5.php">PHP 5 ChangeLog</a>
</p>
<p class="panel">
<a href="/ChangeLog-4.php">PHP 4 ChangeLog</a>
</p>
<div class="panel">
<a href="http://museum.php.net/">PHP Museum</a>
</div>
<div class="panel">
<div class="headline">Want a PHP serialized list of the PHP releases?</div>
<div class="body">
<ul>
<li>Add <a href="?serialize">?serialize</a> to the url</li>
<li>Only want PHP 5 releases? <a href="?serialize&amp;version=5">&amp;version=5</a></li>
<li>The last 3? <a href="?serialize&amp;version=5&amp;max=3">&amp;max=3</a></li>
</ul>
</div>
</div>
<div class="panel">
<div class="headline">Want a JSON list of the PHP releases?</div>
<div class="body">
<ul>
<li>Add <a href="?json">?json</a> to the url</li>
<li>Only want PHP 5 releases? <a href="?json&amp;version=5">&amp;version=5</a></li>
<li>The last 3? <a href="?json&amp;version=5&amp;max=3">&amp;max=3</a></li>
</ul>
</div>
</div>
';
site_header("Releases", array(
'current' => 'downloads',
'css' => '/styles/releases.css',
));
?>
<h1>Unsupported Historical Releases</h1>
<p>
We have collected all the official information and code available for
past PHP releases. You can find more details on the current release
on <a href="/downloads.php">our downloads page</a>. Please note that
<em>older releases are listed for archival purposes only, and
they are no longer supported</em>.
</p>
<p>
<em>Note to Windows users: Only PHP 5.3+ versions are available as both VC6 and VC9 builds.
All versions prior were built using VC6.</em>
</p>
<?php
function mk_rel($major, $ver, $date, $announcement, $source, $windows, $museum) {
printf("<a id=\"%s\"></a>\n<h2>%1\$s</h2>\n<ul>\n <li>Released: %s</li>\n <li>Announcement: ", ($pos = strpos($ver, " ")) ? substr($ver, 0, $pos) : $ver, $date);
if ($announcement) {
if (is_array($announcement)) {
foreach($announcement as $ann => $url) {
echo '<a href="'.$url.'">' .$ann. '</a> ';
}
} else {
$url = str_replace(".", "_", $ver);
echo '<a href="/releases/' .$url. '.php">English</a>';
}
} else {
echo "None";
}
echo "</li>\n";
if ($major != 3) {
echo ' <li><a href="/ChangeLog-'.$major.'.php#' .$ver. '">ChangeLog</a></li>';
}
echo "\n <li>\n Download:\n";
if (!$museum) {
echo "<ul>\n";
foreach(array_merge($source, $windows) as $src) {
echo " <li>\n";
if (isset($src['filename'])) {
download_link($src["filename"], $src["name"]); echo "<br>\n";
if (isset($src["md5"])) {
echo '<span class="md5sum">md5: ' .$src["md5"]. "</span>\n";
if (isset($src["sha256"])) {
echo '<br/>';
}
}
if (isset($src["sha256"])) {
echo '<span class="sha256sum">sha256: ' .$src["sha256"]. "</span>\n";
}
} else {
echo '<a href="'.$src['link'].'">'.$src['name'].'</a>';
}
echo " </li>\n";
}
echo "</ul>\n";
} else {
foreach($source as $src) {
if (!isset($src["filename"])) {
continue;
}
printf('<a href="http://museum.php.net/php%d/%s">%s</a>'."\n", $major, $src["filename"], $src["name"]);
}
foreach($windows as $src) {
printf('<a href="http://museum.php.net/%s/%s">%s</a>'."\n", ($major == 5 ? "php5" : "win32"), $src["filename"], $src["name"]);
}
}
echo " </li>\n";
echo " </ul>\n";
}
$latest = max(array_keys($OLDRELEASES));
foreach($OLDRELEASES as $major => $a) {
echo '<a id="v' .$major. '"></a>';
if ($major != $latest) {
echo "\n<hr>\n";
if ($major == 4) {
echo '<p>Support for PHP 4 has been <b style="color: red;">discontinued</b> since 2007-12-31. Please consider upgrading to PHP 5.</p>'."\n";
}
}
$i = 0;
foreach($a as $ver => $release) {
$i++;
mk_rel(
$major,
$ver,
$release["date"],
isset($release["announcement"]) ? $release["announcement"] : false,
$release["source"],
(isset($release["windows"]) ? $release["windows"] : array()),
isset($release["museum"]) ? $release["museum"] : ($i<3 ? false : true)
);
}
}
site_footer(array("sidebar" => $SIDEBAR_DATA));