diff --git a/openapi.yml b/openapi.yml index 5d2d6da9cd..babc00c64d 100644 --- a/openapi.yml +++ b/openapi.yml @@ -92,3 +92,69 @@ paths: type: string format: date-time + "/release-candidates.php": + get: + summary: "Currently RC versions of PHP." + parameters: + - in: query + name: format + schema: + type: string + enum: [ "json", "serialize" ] + required: false + description: Output format + - in: query + name: only + schema: + type: string + enum: [ "dev_versions" ] + required: false + description: Include only dev version numbers + + responses: + "200": + description: "Actively RC per-branch versions of PHP." + content: + "application/json": + schema: + type: array + items: + type: object + properties: + active: + description: "Whether RC version is active" + type: boolean + release: + type: object + properties: + type: + description: "Unstable release type" + type: string + enum: + - alpha + - beta + - RC + number: + description: "Unstable release number" + type: integer + sha256_gz: + description: "Unstable release gz hash" + type: string + sha256_bz2: + description: "Unstable release bz2 hash" + type: string + sha256_xz: + description: "Unstable release xz hash" + type: string + date: + description: "Date of release" + type: string + baseurl: + description: "Download base URL" + type: string + enabled: + description: "enabled" + type: boolean + dev_version: + description: "dev_version" + type: string diff --git a/release-candidates.php b/release-candidates.php index d3a6c46432..3985861f77 100644 --- a/release-candidates.php +++ b/release-candidates.php @@ -3,6 +3,26 @@ include_once __DIR__ . '/include/prepend.inc'; include_once __DIR__ . '/include/release-qa.php'; +if (isset($_GET["format"])) { + $output = $QA_RELEASES; + + if (($_GET['only'] ?? null) === 'dev_versions') { + $output = $output['reported']; + } + + switch ($_GET['format'] ?? null) { + case 'json': + header('Content-Type: application/json; charset=UTF-8'); + echo json_encode($output); + exit; + case 'serialize': + default: + header('Content-Type: text/plain; charset=UTF-8'); + echo serialize($output); + exit; + } +} + $SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__)); $SIDEBAR_DATA = ' @@ -17,6 +37,13 @@ builds, please file a report on GitHub Issues. +
The QA API is simple, and is based on the query string. Pass in only=dev-versions
(the only type currently), along with the desired format (serialize
or json
).