Commit: a2106dccfb40ec7443650617632c37b3c853102a Author: Ben Ramsey <[email protected]> Mon, 6 Apr 2015 10:08:42 -0500 Parents: bbb58d9d6cab1f9a70cc820ad54535cf50caa553 Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=a2106dccfb40ec7443650617632c37b3c853102a Log: Adding clarity to the variable names for the JSON/serialized output Changed paths: M releases/index.php Diff: diff --git a/releases/index.php b/releases/index.php index 635d69c..3a43919 100644 --- a/releases/index.php +++ b/releases/index.php @@ -8,7 +8,7 @@ if (isset($_GET["serialize"]) || isset($_GET["json"])) { $RELEASES[5][$PHP_5_4_VERSION]["date"] = $PHP_5_4_DATE; $RELEASES = $RELEASES + $OLDRELEASES; - $return = array(); + $machineReadable = array(); if (isset($_GET["version"])) { $ver = (int)$_GET["version"]; @@ -20,14 +20,14 @@ if (isset($_GET["serialize"]) || isset($_GET["json"])) { $max = (int)$_GET["max"]; if ($max == -1) { $max = PHP_INT_MAX; } - $return = array($version => $r); + $machineReadable = array($version => $r); $count = 1; /* check if other $RELEASES[$ver] are there */ /* e.g., 5_3, 5_4, and 5_5 all exist and have a release */ while(($z = each($RELEASES[$ver])) && $count++ < $max) { - $return[$z[0]] = $z[1]; + $machineReadable[$z[0]] = $z[1]; } foreach($OLDRELEASES[$ver] as $version => $release) { @@ -35,32 +35,31 @@ if (isset($_GET["serialize"]) || isset($_GET["json"])) { break; } - $return[$version] = $release; + $machineReadable[$version] = $release; } } else { $r["version"] = $version; - $return = $r; + $machineReadable = $r; } } else { - $return = array("error" => "Unknown version"); + $machineReadable = array("error" => "Unknown version"); } } else { - $array = array(); + $machineReadable = array(); foreach($RELEASES as $major => $release) { list($version, $r) = each($release); $r["version"] = $version; - $array[$major] = $r; + $machineReadable[$major] = $r; } - $return = $array; } if (isset($_GET["serialize"])) { header('Content-type: text/plain'); - echo serialize($return); + echo serialize($machineReadable); } elseif (isset($_GET["json"])) { header('Content-Type: application/json'); - echo json_encode($return); + echo json_encode($machineReadable); } return; } -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
