-
Notifications
You must be signed in to change notification settings - Fork 626
Add windows QA builds #1607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add windows QA builds #1607
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>) | ||
| <?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]); | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.