Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
428 changes: 428 additions & 0 deletions backend/win-qa-releases.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<p class="panel"><a href="download-docs.php">Documentation Download</a></p>
<p class="panel"><a href="download-logos.php">PHP Logos</a></p>
<p class="panel"><a href="/release-candidates.php">Release Candidates</a></p>
<p class="panel"><a href="/pre-release-builds.php">Pre-Release Builds</a></p>
<p class="panel"><a href="/git.php">Development Sources (git)</a></p>
<p class="panel"><a href="/releases/">Old Archives</a></p>
';
Expand Down
8 changes: 7 additions & 1 deletion error.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// Get URI for this request, strip leading slash
// See langchooser.inc for more info on STRIPPED_URI
$URI = substr($_SERVER['STRIPPED_URI'], 1);
$queryString = $_SERVER['QUERY_STRING'] ?? '';

// ============================================================================
// Mozilla Search Sidebar plugin resource file handling (need to be mirror
Expand Down Expand Up @@ -538,6 +539,7 @@
# Removed pages
"tips.php" => "urlhowto",
"tips" => "urlhowto",
"release-candidates.php" => "pre-release-builds",
];

$external_redirects = [
Expand Down Expand Up @@ -677,7 +679,11 @@
$URI = $uri_aliases[$URI];
/* If it was a page alias, redirect right away */
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) {
mirror_redirect("/$URI.php");
$target = "/$URI.php";
if ($queryString !== '') {
$target .= (strpos($target, '?') === false ? '?' : '&') . $queryString;
}
mirror_redirect($target);
}
}

Expand Down
2 changes: 1 addition & 1 deletion get-involved.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<h3 class="content-title" id="ways-to-contribute">Four Best Ways to Contribute</h3>

<ol class="content-box listed">
<li>Running test suites in <a href="/release-candidates.php">RC</a>
<li>Running test suites in <a href="/pre-release-builds.php">RC</a>
and <a href="https://php.net/releases">release</a> distributions of PHP</li>
<li>Help finding and diagnosing failed tests, see
the <a href="https://qa.php.net/write-test.php">phpt documentation</a></li>
Expand Down
4 changes: 2 additions & 2 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ paths:
type: string
format: date-time

"/release-candidates.php":
"/pre-release-builds.php":
get:
summary: "Currently RC versions of PHP."
summary: "Current pre-release versions of PHP."
parameters:
- in: query
name: format
Expand Down
301 changes: 301 additions & 0 deletions pre-release-builds.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
<?php
$_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 = '
<div class="panel">
Test Releases
<div class="body">
The downloads on this page are not meant to be run in production. They are
for testing only.
</div>

<div class="body">
If you find a problem when running your library or application with these
builds, please file a report on
<a href="https://github.com/php/php-src/issues/">GitHub Issues</a>.
</div>
<br/>
QA Releases API
<div class="body">
<p>
The QA API is based on the query string.
</p>
<p>
Pass in the <code>format</code> parameter, with <code>serialize</code> or
<code>json</code> as value to obtain all information:
</p>
<ul>
<li><a href="https://php.net/pre-release-builds.php?format=json">/pre-release-builds.php?format=json</a></li>
<li><a href="https://php.net/pre-release-builds.php?format=serialize">/pre-release-builds.php?format=serialize</a></li>
</ul>
<p>
To only try dev version numbers, add <code>only=dev_versions</code>:
</p>
<ul>
<li><a href="https://php.net/pre-release-builds.php?format=json&only=dev_versions">/pre-release-builds.php?format=json&only=dev_versions</a></li>
</ul>
</div>
</div>
';

site_header("Pre-Release Builds", [
'current' => 'downloads',
]);

?>
<h1>Pre-Release Builds</h1>
<p>
This page contains links to the Pre-release builds that the release
managers create before each actual release. These builds are meant for the
community to test whether no inadvertent changes have been made, and
whether no regressions have been introduced.
</p>

<h3>Source Builds:</h3>
<?php if (!empty($QA_RELEASES['releases'])) : ?>
<?php $plural = count($QA_RELEASES['releases']) > 1 ? 's' : ''; ?>

<?php foreach ($QA_RELEASES['releases'] as $pversion => $info) : ?>
<h3 class="title">
PHP <?php echo $info['version']; ?>
</h3>
<div class="content-box">

<ul>
<?php foreach ($info['files'] as $file_type => $file_info) : ?>
<li>
<a href="<?php echo $file_info['path'] ?>"><?php echo "php-{$info['version']}.tar.{$file_type}"; ?></a>
<span class="releasedate"><?php echo date('d M Y', strtotime($info['date'])); ?></span>
<?php foreach ($QA_CHECKSUM_TYPES as $algo): ?>
<span class="<?php echo $algo; ?>">
<?php if (isset($file_info[$algo]) && strlen($file_info[$algo])) : ?>
<?php echo $file_info[$algo]; ?>
<?php else: ?>
<em><small>No checksum value available</small></em>)&nbsp;
<?php endif; ?>
<?php endforeach; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
<?php else: ?>
<span class='lihack'>There are no QA releases available at the moment to test.</span>
<?php endif; ?>

<h3>Windows Builds:</h3>
<?php
$winQaFile = __DIR__ . '/backend/win-qa-releases.json';
$winQaBase = 'https://downloads.php.net/~windows/qa/';
$winQaMessage = '';
$winQaReleases = [];

if (is_readable($winQaFile)) {
$raw = @file_get_contents($winQaFile);
$decoded = $raw ? json_decode($raw, true) : null;
if (is_array($decoded)) {
$allowedBranches = [];
if (!empty($QA_RELEASES['releases'])) {
foreach (array_keys($QA_RELEASES['releases']) as $pversion) {
$parts = explode('.', (string) $pversion);
if (count($parts) >= 2) {
$branchKey = $parts[0] . '.' . $parts[1];
$allowedBranches[$branchKey] = true;
}
}
}

$buildLabel = static function (string $key, array $entry): string {
$tool = 'VS';
if (strpos($key, 'vs17') !== false) {
$tool .= '17';
} elseif (strpos($key, 'vs16') !== false) {
$tool .= '16';
} elseif (strpos($key, 'vc15') !== false) {
$tool = 'VC15';
}

$arch = (strpos($key, 'x64') !== false) ? 'x64' : ((strpos($key, 'x86') !== false) ? 'x86' : '');
$ts = (strpos($key, 'nts') !== false) ? 'Non Thread Safe' : 'Thread Safe';

if (strncmp($key, 'nts-', 4) === 0) {
$ts = 'Non Thread Safe';
} elseif (strncmp($key, 'ts-', 3) === 0) {
$ts = 'Thread Safe';
}

return trim(($tool ? $tool . ' ' : '') . ($arch ? $arch . ' ' : '') . $ts);
};

$packageNames = [
'zip' => 'Zip',
'debug_pack' => 'Debug Pack',
'devel_pack' => 'Development package (SDK to develop PHP extensions)',
];

$makeListItem = static function (string $label, array $fileInfo, ?string $mtime, bool $includeSha) use ($winQaBase): ?string {
$path = $fileInfo['path'] ?? '';
if ($path === '') {
return null;
}

$href = $winQaBase . ltrim($path, '/');
$size = $fileInfo['size'] ?? '';
$sha = $fileInfo['sha256'] ?? '';
$hrefAttr = htmlspecialchars($href, ENT_QUOTES, 'UTF-8');
$labelText = htmlspecialchars($label, ENT_QUOTES, 'UTF-8');

$parts = ['<a href="' . $hrefAttr . '">' . $labelText . '</a>'];
if ($size !== '') {
$parts[] = '<span class="size">' . htmlspecialchars($size, ENT_QUOTES, 'UTF-8') . '</span>';
}

if ($mtime) {
$timestamp = strtotime($mtime);
if ($timestamp) {
$parts[] = '<span class="releasedate">' . gmdate('d M Y', $timestamp) . '</span>';
}
}

if ($includeSha && $sha !== '') {
$parts[] = '<span class="sha256">' . htmlspecialchars($sha, ENT_QUOTES, 'UTF-8') . '</span>';
}

return '<li>' . implode(' ', $parts) . '</li>';
};

foreach ($decoded as $branch => $info) {
if (!is_array($info) || empty($info['version'])) {
continue;
}

if ($branch === 'comment') {
continue;
}

if (!empty($allowedBranches) && empty($allowedBranches[$branch])) {
continue;
}

$topItems = [];
if (!empty($info['source']) && is_array($info['source'])) {
$item = $makeListItem('Download source code', $info['source'], $info['source']['mtime'] ?? null, false);
if ($item !== null) {
$topItems[] = $item;
}
}

if (!empty($info['test_pack']) && is_array($info['test_pack'])) {
$item = $makeListItem('Download tests package (phpt)', $info['test_pack'], $info['test_pack']['mtime'] ?? null, false);
if ($item !== null) {
$topItems[] = $item;
}
}

$builds = [];
foreach ($info as $buildKey => $entry) {
if (!is_array($entry) || in_array($buildKey, ['version', 'source', 'test_pack'], true)) {
continue;
}

$label = $buildLabel($buildKey, $entry);
if ($label === '') {
continue;
}

$packageItems = [];
foreach ($packageNames as $pkgKey => $pkgLabel) {
if (empty($entry[$pkgKey]) || !is_array($entry[$pkgKey])) {
continue;
}

$rendered = $makeListItem($pkgLabel, $entry[$pkgKey], $entry['mtime'] ?? null, true);
if ($rendered !== null) {
$packageItems[] = $rendered;
}
}

if (empty($packageItems)) {
continue;
}

$builds[] = [
'label' => $label,
'items' => $packageItems,
];
}

if (empty($topItems) && empty($builds)) {
continue;
}

$winQaReleases[] = [
'version_label' => $info['version'],
'top_items' => $topItems,
'builds' => $builds,
];
}
} else {
$winQaMessage = 'Windows QA release index could not be parsed.';
}
} else {
$winQaMessage = 'Windows QA release index is unavailable.';
}

if ($winQaMessage !== '') {
echo '<p>', htmlspecialchars($winQaMessage), '</p>';
} elseif (empty($winQaReleases)) {
echo "<p>No Windows QA builds match the currently active QA releases.</p>";
} else {
foreach ($winQaReleases as $release) {
$versionLabel = $release['version_label'];

echo '<h3 class="title">PHP ', htmlspecialchars($versionLabel), '</h3>';
echo '<div class="content-box windows-qa">';
if (!empty($release['top_items'])) {
echo '<ul class="windows-qa-list">';
foreach ($release['top_items'] as $item) {
echo $item;
}
echo '</ul>';
}

foreach ($release['builds'] as $build) {
echo '<h5 style="margin:-10px 0 0 10px;">' . $build['label'] . '</h5>';
echo '<ul class="windows-qa-list">';
foreach ($build['items'] as $item) {
echo $item;
}
echo '</ul>';
}
echo '</div>';
}
}
?>

<?php
site_footer(['sidebar' => $SIDEBAR_DATA]);

Loading
Loading