File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ $ _SERVER ['BASE_PAGE ' ] = 'releases/active.php ' ;
3+
4+ include_once __DIR__ . '/../include/prepend.inc ' ;
5+ include_once $ _SERVER ['DOCUMENT_ROOT ' ] . '/include/branches.inc ' ;
6+
7+ header ('Content-Type: application/json; charset=UTF-8 ' );
8+
9+ $ states = [];
10+
11+ function formatDate ($ date = null ) {
12+ return $ date !== null ? $ date ->format ('c ' ) : null ;
13+ }
14+
15+ foreach (get_all_branches () as $ major => $ releases ) {
16+ $ states [$ major ] = [];
17+ foreach ($ releases as $ branch => $ release ) {
18+ $ states [$ major ][$ branch ] = [
19+ 'state ' => get_branch_support_state ($ branch ),
20+ 'initial ' => formatDate (get_branch_release_date ($ branch )),
21+ 'until ' => formatDate (get_branch_bug_eol_date ($ branch )),
22+ 'eol ' => formatDate (get_branch_security_eol_date ($ branch )),
23+ ];
24+ }
25+ krsort ($ states [$ major ]);
26+ }
27+
28+ krsort ($ states );
29+
30+ echo json_encode ($ states );
You can’t perform that action at this time.
0 commit comments