Commit:    6719d065bb429cabf637a8c5a2cceff1c460fd9c
Author:    Adam Harvey <[email protected]>         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());


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to