-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a rough EOL page, per the Internals discussion. Copy editing welc…
…ome! I haven't linked this from anywhere yet, pending further discussion.
- Loading branch information
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |