From 464ffa5497f19d25da15941752d3ec6ee3e63d29 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Mon, 27 Oct 2014 15:16:39 -0700 Subject: [PATCH] Add a more generic ability to override support dates. --- include/branches.inc | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/include/branches.inc b/include/branches.inc index dd5e33d11..73fd3eac0 100644 --- a/include/branches.inc +++ b/include/branches.inc @@ -2,6 +2,24 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/releases.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc'; +/* Branch overrides. For situations where we've changed the exact dates for a + * branch's active support and security fix EOLs, these can be reflected here. + * + * Supported keys are: + * - stable: the end of active support (usually two years after release). + * - security: the end of security support (usually release + 3 years). + */ +$BRANCHES = array( + '5.3' => array( + 'stable' => '2013-07-11', + 'security' => '2014-08-14', + ), + '5.4' => array( + 'stable' => '2014-09-14', + 'security' => '2015-09-14', + ), +); + function format_interval($from, $to) { try { $from_obj = $from instanceof DateTime ? $from : new DateTime($from); @@ -196,9 +214,8 @@ function get_initial_release($branch) { } function get_branch_bug_eol_date($branch) { - // Hardcode 5.3. - if (strncmp($branch, '5.3', 3) == 0) { - return new DateTime('2013-07-11'); + if (isset($GLOBALS['BRANCHES'][$branch]['stable'])) { + return new DateTime($GLOBALS['BRANCHES'][$branch]['stable']); } $date = get_branch_release_date($branch); @@ -207,9 +224,8 @@ function get_branch_bug_eol_date($branch) { } function get_branch_security_eol_date($branch) { - // Hardcode 5.3. - if (strncmp($branch, '5.3', 3) == 0) { - return new DateTime('2014-08-14'); + if (isset($GLOBALS['BRANCHES'][$branch]['security'])) { + return new DateTime($GLOBALS['BRANCHES'][$branch]['security']); } $date = get_branch_release_date($branch);