1
0
mirror of https://github.com/php/web-php.git synced 2026-03-24 07:12:16 +01:00
Files
archived-web-php/include/release-qa.php
2025-08-15 09:34:55 -07:00

184 lines
8.0 KiB
PHP

<?php
/*
What this file does:
- Generates the download links found at qa.php.net
- Determines which test results are emailed to news.php.net/php.qa.reports
- Defines $QA_RELEASES for internal and external (api.php) use, contains all qa related information for future PHP releases
Documentation:
$QA_RELEASES documentation:
Configuration:
- Key is future PHP version number
- Example: If 5.3.6 is the latest stable release, then use 5.3.7 because 5.3.7-dev is our qa version
- Typically, this is the only part needing changed
- active (bool):
- It's active and being tested here
- Meaning, the version will be reported to the qa.reports list, and be linked at qa.php.net
- File extensions .tar.gz and .tar.bz2 are assumed to be available
- release (array):
- type: RC, alpha, and beta are examples (case should match filename case)
- version: 0 if no such release exists, otherwise an integer of the rc/alpha/beta number
- sha256_bz2: sha256 checksum of this downloadable .tar.bz2 file
- sha256_gz: sha256 checksum of this downloadable .tar.gz file
- sha256_xz: sha256 checksum of this downloadble .xz file
- date: date of release e.g., 21 May 2011
- baseurl: base url of where these downloads are located
- Multiple checksums can be available, see the $QA_CHECKSUM_TYPES array below
Other variables within $QA_RELEASES are later defined including:
- reported: versions that make it to the qa.reports mailing list
- release: all current qa releases, including paths to dl urls (w/ sha256 info)
- dev_version: dev version
- $QA_RELEASES is made available at qa.php.net/api.php
TODO:
- Save all reports (on qa server) for all tests, categorize by PHP version (see buildtest-process.php)
- Consider storing rc downloads at one location, independent of release master
- Determine best way to handle rc baseurl, currently assumes .tar.gz/tar.bz2 will exist
- Determine if $QA_RELEASES is compatible with all current, and most future configurations
- Determine if $QA_RELEASES can be simplified
- Determine if alpha/beta options are desired
- Unify then create defaults for most settings
- Add option to allow current releases (e.g., retrieve current release info via daily cron, cache, check, configure ~ALLOW_CURRENT_RELEASES)
*/
$QA_RELEASES = [
'8.1.27' => [
'active' => true,
'release' => [
'type' => 'RC',
'number' => 0,
'sha256_gz' => '',
'sha256_bz2' => '',
'sha256_xz' => '',
'date' => '07 Nov 2023',
'baseurl' => 'https://downloads.php.net/',
],
],
'8.2.27' => [
'active' => true,
'release' => [
'type' => 'RC',
'number' => 0,
'sha256_bz2' => '',
'sha256_gz' => '',
'sha256_xz' => '',
'date' => '05 Dec 2024',
'baseurl' => 'https://downloads.php.net/',
],
],
'8.3.25' => [
'active' => true,
'release' => [
'type' => 'RC',
'number' => 1,
'sha256_bz2' => '92192c5affbaf1d181357511e47e7bb87a6be925555332636ab546cb9578a889',
'sha256_gz' => '3e65cacc2304e7ced1b3204097d0fc0b9cafaa67f786446305813473f6915df4',
'sha256_xz' => '82538664d35eaf6302fb43ef201e956717ef16430268e2172b778bcce49a56d9',
'date' => '14 Aug 2025',
'baseurl' => 'https://downloads.php.net/~eric/',
],
],
'8.4.12' => [
'active' => true,
'release' => [
'type' => 'RC',
'number' => 1,
'sha256_bz2' => 'fd0565634394fe7f175c4dfee0aa8fbbde1ae58ad468c2a5b86cdd9ae14fa5f1',
'sha256_gz' => '0392cd9d3f6310b3b266e8dd71d2852630854ee0b6d21facbc2fb301bc29e8e2',
'sha256_xz' => '3b0b299f4fefe348ffbceeee08efa2db85782a290efd09f2996107b34403c062',
'date' => '14 Aug 2025',
'baseurl' => 'https://downloads.php.net/~saki/',
],
],
'8.5.0' => [
'active' => true,
'release' => [
'type' => 'beta',
'number' => 1,
'sha256_bz2' => '3b9712d3dc33c05271c02c23b7edcfd86651660d7aa3b10e912597c8f35ab1a2',
'sha256_gz' => 'd28f6de0744fa733db898ddcdeaa784a5e87ec1b4b4822e83529d9a76229ea61',
'sha256_xz' => '60fe18a9802d18a9c9be05d43b4d130b3aeab27a031a29d0e267b7b4c8dff4a7',
'date' => '14 Aug 2025',
'baseurl' => 'https://downloads.php.net/~edorian/',
],
],
];
/*** End Configuration *******************************************************************/
// This is a list of the possible checksum values that can be supplied with a QA release. Any
// new algorithm is read from the $QA_RELEASES array under the 'release' index for each version
// in the form of "$algorithm_$filetype".
//
// For example, if SHA512 were to be supported, the following indices would have to be added:
//
// 'sha512_bz2' => 'xxx',
// 'sha512_gz' => 'xxx',
// 'sha512_xz' => 'xxx',
$QA_CHECKSUM_TYPES = ['sha256'];
// $QA_RELEASES eventually contains just about everything, also for external use
// release : These are encouraged for use (e.g., linked at qa.php.net)
// reported : These are allowed to report @ the php.qa.reports mailing list
(function(&$QA_RELEASES) use ($QA_CHECKSUM_TYPES) {
foreach ($QA_RELEASES as $pversion => $info) {
if (isset($info['active']) && $info['active']) {
// Allow -dev versions of all active types
// Example: 5.3.6-dev
$QA_RELEASES['reported'][] = "{$pversion}-dev";
$QA_RELEASES[$pversion]['dev_version'] = "{$pversion}-dev";
// Allow -dev version of upcoming qa releases (rc/alpha/beta)
// @todo confirm this php version format for all dev versions
if ((int)$info['release']['number'] > 0) {
$QA_RELEASES['reported'][] = "{$pversion}{$info['release']['type']}{$info['release']['number']}";
if (!empty($info['release']['baseurl'])) {
// php.net filename format for qa releases
// example: php-5.3.0RC2
$fn_base = 'php-' . $pversion . $info['release']['type'] . $info['release']['number'];
$QA_RELEASES[$pversion]['release']['version'] = $pversion . $info['release']['type'] . $info['release']['number'];
foreach ([ 'bz2', 'gz', 'xz' ] as $file_type) {
foreach ($QA_CHECKSUM_TYPES as $algo) {
if (isset($info['release'][$algo . '_' . $file_type])) {
$QA_RELEASES[$pversion]['release']['files'][$file_type][$algo] = $info['release'][$algo . '_' . $file_type];
}
}
if (!empty($QA_RELEASES[$pversion]['release']['files'][$file_type])) {
$QA_RELEASES[$pversion]['release']['files'][$file_type]['path']= $info['release']['baseurl'] . $fn_base . '.tar.' . $file_type;
}
}
if (empty($QA_RELEASES[$pversion]['release']['files'])) {
$QA_RELEASES[$pversion]['release']['enabled'] = false;
}
}
} else {
$QA_RELEASES[$pversion]['release']['enabled'] = false;
}
}
}
// Sorted information for later use
// @todo need these?
// $QA_RELEASES['releases'] : All current versions with active qa releases
foreach ($QA_RELEASES as $pversion => $info) {
if (isset($info['active']) && $info['active'] && !empty($info['release']['number'])) {
$QA_RELEASES['releases'][$pversion] = $info['release'];
}
}
})($QA_RELEASES);