mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Don't show recently EOLed branches in the supported versions table.
Changed the behaviour of get_active_branches() so that callers can choose whether to get recently EOLed branches or not. (This is basically for the supported versions page; the other callers -- namely the front page download links and bug tracker backend -- likely still want the previous behaviour.) After all, it's a little weird listing 5.5 as a supported version in the table when we just made a big deal of EOLing it!
This commit is contained in:
@@ -122,14 +122,18 @@ function get_all_branches() {
|
||||
return $branches;
|
||||
}
|
||||
|
||||
function get_active_branches() {
|
||||
function get_active_branches($include_recent_eols = true) {
|
||||
$branches = array();
|
||||
$now = new DateTime;
|
||||
|
||||
foreach ($GLOBALS['RELEASES'] as $major => $releases) {
|
||||
foreach ($releases as $version => $release) {
|
||||
if ($branch = version_number_to_branch($version)) {
|
||||
if ($now < get_branch_security_eol_date($branch)->add($GLOBALS['KEEP_EOL'])) {
|
||||
$threshold = get_branch_security_eol_date($branch);
|
||||
if ($include_recent_eols) {
|
||||
$threshold->add($GLOBALS['KEEP_EOL']);
|
||||
}
|
||||
if ($now < $threshold) {
|
||||
$branches[$major][$branch] = $release;
|
||||
$branches[$major][$branch]['version'] = $version;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ $VERSION_NOTES = array(
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (get_active_branches() as $major => $releases): ?>
|
||||
<?php foreach (get_active_branches(false) as $major => $releases): ?>
|
||||
<?php ksort($releases) ?>
|
||||
<?php foreach ($releases as $branch => $release): ?>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user