com web/php: Use the new eol flag for an active release JSON feed.: include/branches.inc releases/active.php

From: Date: Wed, 01 Oct 2014 00:08:52 +0000
Subject: com web/php: Use the new eol flag for an active release JSON feed.: include/branches.inc releases/active.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-20006@lists.php.net to get a copy of this message
Commit: 6719d065bb429cabf637a8c5a2cceff1c460fd9c Author: Adam Harvey <aharvey@php.net> Tue, 30 Sep 2014 17:08:52 -0700 Parents: 295c61015cd6da71f09e1823fe28b6d1f27aac2a Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=6719d065bb429cabf637a8c5a2cceff1c460fd9c Log: Use the new eol flag for an active release JSON feed. This is mostly useful so the bug tracker can still get a list of active releases when the QA site is down (cough, cough). Changed paths: M include/branches.inc A releases/active.php Diff: diff --git a/include/branches.inc b/include/branches.inc index b524fcc..45d1964 100644 --- a/include/branches.inc +++ b/include/branches..inc @@ -9,6 +9,22 @@ function version_number_to_branch($version) { } } +function get_active_branches() { + $branches = array(); + + foreach ($GLOBALS['RELEASES'] as $major => $releases) { + foreach ($releases as $version => $release) { + if ($branch = version_number_to_branch($version)) { + if (empty($release['eol'])) { + $branches[$major][$branch] = $release; + } + } + } + } + + return $branches; +} + /* If you provide an array to $always_include, note that the version numbers * must be in $RELEASES _and_ must be the full version number, not the branch: * ie provide array('5.3.29'), not array('5.3').. */ diff --git a/releases/active.php b/releases/active.php new file mode 100644 index 0000000..1aa8df0 --- /dev/null +++ b/releases/active.php @@ -0,0 +1,9 @@ +<?php +$_SERVER['BASE_PAGE'] = 'releases/active.php'; + +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/branches.inc'; + +header('Content-Type: application/json; charset=UTF-8'); + +echo json_encode(get_active_branches());

« previous php.webmaster (#20006) next »