Skip to content

Commit 1685dfd

Browse files
committed
Extract out $BRANCHES into its own include file that returns the data rather than assigns it to a global.
1 parent e0d6174 commit 1685dfd

2 files changed

Lines changed: 34 additions & 31 deletions

File tree

include/branch-overrides.inc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
return [
4+
/* 3.0 is here because version_compare() can't handle the only version in
5+
* $OLDRELEASES, and it saves another special case in
6+
* get_branch_security_eol_date(). */
7+
'3.0' => [
8+
'security' => '2000-10-20',
9+
],
10+
'5.3' => [
11+
'stable' => '2013-07-11',
12+
'security' => '2014-08-14',
13+
],
14+
'5.4' => [
15+
'stable' => '2014-09-14',
16+
'security' => '2015-09-03',
17+
],
18+
'5.5' => [
19+
'stable' => '2015-07-10',
20+
'security' => '2016-07-21',
21+
],
22+
'5.6' => [
23+
'stable' => '2017-01-19',
24+
'security' => '2018-12-31',
25+
],
26+
'7.0' => [
27+
'stable' => '2018-01-04',
28+
'security' => '2019-01-10',
29+
],
30+
'8.4' => [
31+
'date' => '2024-11-21',
32+
],
33+
];

include/branches.inc

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,7 @@ include_once __DIR__ . '/version.inc';
1010
* - stable: the end of active support (usually two years after release).
1111
* - security: the end of security support (usually release + 3 years).
1212
*/
13-
$BRANCHES = [
14-
/* 3.0 is here because version_compare() can't handle the only version in
15-
* $OLDRELEASES, and it saves another special case in
16-
* get_branch_security_eol_date(). */
17-
'3.0' => [
18-
'security' => '2000-10-20',
19-
],
20-
'5.3' => [
21-
'stable' => '2013-07-11',
22-
'security' => '2014-08-14',
23-
],
24-
'5.4' => [
25-
'stable' => '2014-09-14',
26-
'security' => '2015-09-03',
27-
],
28-
'5.5' => [
29-
'stable' => '2015-07-10',
30-
'security' => '2016-07-21',
31-
],
32-
'5.6' => [
33-
'stable' => '2017-01-19',
34-
'security' => '2018-12-31',
35-
],
36-
'7.0' => [
37-
'stable' => '2018-01-04',
38-
'security' => '2019-01-10',
39-
],
40-
'8.4' => [
41-
'date' => '2024-11-21',
42-
],
43-
];
13+
$BRANCHES = require __DIR__ . '/branch-overrides.inc';
4414

4515
/* Time to keep EOLed branches in the array returned by get_active_branches(),
4616
* which is used on the front page download links and the supported versions

0 commit comments

Comments
 (0)