Skip to content

Commit

Permalink
Add a rough EOL page, per the Internals discussion. Copy editing welc…
Browse files Browse the repository at this point in the history
…ome!

I haven't linked this from anywhere yet, pending further discussion.
  • Loading branch information
LawnGnome committed Aug 2, 2012
1 parent 157d01e commit 87df545
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
60 changes: 60 additions & 0 deletions eol.php
Original file line number Diff line number Diff line change
@@ -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 changes: 47 additions & 0 deletions include/branches.inc
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 87df545

Please sign in to comment.