1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Add a rough EOL page, per the Internals discussion. Copy editing welcome!

I haven't linked this from anywhere yet, pending further discussion.
This commit is contained in:
Adam Harvey
2012-08-02 14:31:31 +08:00
parent 157d01e664
commit 87df5451ed
2 changed files with 107 additions and 0 deletions

60
eol.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
$_SERVER['BASE_PAGE'] = 'eol.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/branches.inc';
// Notes for specific branches can be added here, and will appear in the table.
$BRANCH_NOTES = array(
'4.4' => 'Has known remote code execution vulnerabilities.',
);
site_header('Unsupported Branches');
?>
<h1>Unsupported Branches</h1>
<p>
This page lists the end of life date for each unsupported branch of PHP. If
you are using these releases, you are strongly urged to upgrade to
<a href="/downloads">a current version</a>, as using older versions may
expose you to security vulnerabilities and bugs that have been fixed in
more recent versions of PHP.
</p>
<table class="standard">
<thead>
<tr>
<th>Branch</th>
<th colspan="2">Date</th>
<th>Last Release</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach (get_eol_branches() as $major => $branches): ?>
<?php foreach ($branches as $branch => $detail): ?>
<tr>
<td><?php echo htmlspecialchars($branch); ?></td>
<td>
<?php echo date('j M Y', $detail['date']); ?>
</td>
<td>
<?php echo number_format($ago = floor((time() - $detail['date']) / 86400)); ?>
day<?php echo ($ago != 1 ? 's' : ''); ?> ago
</td>
<td>
<a href="/releases/#<?php echo htmlspecialchars($detail['version']); ?>">
<?php echo htmlspecialchars($detail['version']); ?>
</a>
</td>
<td>
<?php echo isset($BRANCH_NOTES[$branch]) ? $BRANCH_NOTES[$branch] : ''; ?>
</td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php site_footer(); ?>

47
include/branches.inc Normal file
View File

@@ -0,0 +1,47 @@
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/releases.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc';
function version_number_to_branch($version) {
$parts = explode('.', $version);
if (count($parts) > 1) {
return "$parts[0].$parts[1]";
}
}
function get_eol_branches() {
$branches = array();
// Gather the last release on each branch into a convenient array.
foreach ($GLOBALS['OLDRELEASES'] as $major => $releases) {
foreach ($releases as $version => $release) {
if ($branch = version_number_to_branch($version)) {
if (!isset($branches[$major][$branch]) || version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
$branches[$major][$branch] = array(
'date' => strtotime($release['date']),
'version' => $version,
);
}
}
}
}
/* Exclude releases from active branches, where active is defined as "in
* the $RELEASES array". */
foreach ($GLOBALS['RELEASES'] as $major => $releases) {
foreach ($releases as $version => $release) {
if ($branch = version_number_to_branch($version)) {
if (isset($branches[$major][$branch])) {
unset($branches[$major][$branch]);
}
}
}
}
krsort($branches);
foreach ($branches as $major => $branch) {
krsort($branch);
}
return $branches;
}