mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Add API for QA (#1262)
This commit is contained in:
66
openapi.yml
66
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
|
||||
|
||||
@@ -3,6 +3,26 @@ $_SERVER['BASE_PAGE'] = 'qa.php';
|
||||
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 @@ $SIDEBAR_DATA = '
|
||||
builds, please file a report on <a
|
||||
href="https://github.com/php/php-src/issues/">GitHub Issues</a>.
|
||||
</div>
|
||||
<div class="body">
|
||||
<p>The QA API is simple, and is based on the query string. Pass in <code>only=dev-versions</code> (the only type currently), along with the desired format (<code>serialize</code> or <code>json</code>).</p>
|
||||
<ul>
|
||||
<li>All information, serialized: https://php.net/release-candidates.php?format=serialize</li>
|
||||
<li>Only dev version numbers, json: https://php.net/release-candidates.php?format=json&only=dev_versions</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user