1
0
mirror of https://github.com/php/pie.git synced 2026-03-23 23:12:17 +01:00

Update to remove superfluous override- prefix and pull latest composer/composer

This commit is contained in:
James Titcumb
2025-02-05 10:26:17 +00:00
parent 504aa88a4b
commit 36da7b2244
7 changed files with 31 additions and 33 deletions

View File

@@ -28,7 +28,7 @@
],
"require": {
"php": "8.1.*||8.2.*||8.3.*||8.4.*",
"composer/composer": "^2.8.5",
"composer/composer": "dev-main",
"composer/pcre": "^3.3.2",
"composer/semver": "^3.4.3",
"fidry/cpu-core-counter": "^1.2",

21
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "819abdc1a00f374dc389cde52c096979",
"content-hash": "010234aff469fe878aace1bf281c1dff",
"packages": [
{
"name": "composer/ca-bundle",
@@ -157,16 +157,16 @@
},
{
"name": "composer/composer",
"version": "2.8.5",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/composer/composer.git",
"reference": "ae208dc1e182bd45d99fcecb956501da212454a1"
"reference": "b70b6bd0709f6b2071935ee2f2b6061b812724d0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/composer/zipball/ae208dc1e182bd45d99fcecb956501da212454a1",
"reference": "ae208dc1e182bd45d99fcecb956501da212454a1",
"url": "https://api.github.com/repos/composer/composer/zipball/b70b6bd0709f6b2071935ee2f2b6061b812724d0",
"reference": "b70b6bd0709f6b2071935ee2f2b6061b812724d0",
"shasum": ""
},
"require": {
@@ -205,6 +205,7 @@
"ext-zip": "Enabling the zip extension allows you to unzip archives",
"ext-zlib": "Allow gzip compression of HTTP requests"
},
"default-branch": true,
"bin": [
"bin/composer"
],
@@ -251,7 +252,7 @@
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/composer/issues",
"security": "https://github.com/composer/composer/security/policy",
"source": "https://github.com/composer/composer/tree/2.8.5"
"source": "https://github.com/composer/composer/tree/main"
},
"funding": [
{
@@ -267,7 +268,7 @@
"type": "tidelift"
}
],
"time": "2025-01-21T14:23:40+00:00"
"time": "2025-02-05T10:20:56+00:00"
},
{
"name": "composer/metadata-minifier",
@@ -7003,13 +7004,15 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"composer/composer": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "8.1.*||8.2.*||8.3.*||8.4.*"
},
"platform-dev": [],
"platform-dev": {},
"platform-overrides": {
"php": "8.1.99"
},

View File

@@ -166,9 +166,9 @@ The `build-path` may contain some templated values which are replaced:
with version 1.2.3 with a `build-path` of `myext-{version}` the actual build
path would become `myext-1.2.3`.
#### `override-download-url-method`
#### `download-url-method`
The `override-download-url-method` directive allows extension maintainers to
The `download-url-method` directive allows extension maintainers to
change the behaviour of downloading the source package.
* Setting this to `composer-default`, which is the default value if not

View File

@@ -40,7 +40,7 @@
"example": "my-extension-source",
"default": null
},
"override-download-url-method": {
"download-url-method": {
"type": "string",
"description": "If specified, this technique will be used to override the URL that PIE uses to download the asset. The default, if not specified, is composer-default.",
"enum": ["composer-default", "pre-packaged-source"],

View File

@@ -18,7 +18,6 @@ use function array_map;
use function array_slice;
use function explode;
use function implode;
use function is_string;
use function parse_url;
use function str_contains;
use function str_starts_with;
@@ -43,7 +42,7 @@ final class Package
private array|null $incompatibleOsFamilies;
private bool $supportZts;
private bool $supportNts;
private DownloadUrlMethod|null $overrideDownloadUrlMethod;
private DownloadUrlMethod|null $downloadUrlMethod;
public function __construct(
private readonly CompletePackageInterface $composerPackage,
@@ -53,14 +52,14 @@ final class Package
private readonly string $version,
private readonly string|null $downloadUrl,
) {
$this->configureOptions = [];
$this->supportZts = true;
$this->supportNts = true;
$this->buildPath = null;
$this->compatibleOsFamilies = null;
$this->incompatibleOsFamilies = null;
$this->priority = 80;
$this->overrideDownloadUrlMethod = null;
$this->configureOptions = [];
$this->supportZts = true;
$this->supportNts = true;
$this->buildPath = null;
$this->compatibleOsFamilies = null;
$this->incompatibleOsFamilies = null;
$this->priority = 80;
$this->downloadUrlMethod = null;
}
public static function fromComposerCompletePackage(CompletePackageInterface $completePackage): self
@@ -99,12 +98,8 @@ final class Package
$package->priority = $phpExtOptions['priority'] ?? 80;
if (
$phpExtOptions !== null
&& array_key_exists('override-download-url-method', $phpExtOptions)
&& is_string($phpExtOptions['override-download-url-method'])
) {
$package->overrideDownloadUrlMethod = DownloadUrlMethod::tryFrom($phpExtOptions['override-download-url-method']);
if ($phpExtOptions !== null && array_key_exists('download-url-method', $phpExtOptions)) {
$package->downloadUrlMethod = DownloadUrlMethod::tryFrom($phpExtOptions['download-url-method']);
}
return $package;
@@ -227,8 +222,8 @@ final class Package
return $this->supportNts;
}
public function overrideDownloadUrlMethod(): DownloadUrlMethod|null
public function downloadUrlMethod(): DownloadUrlMethod|null
{
return $this->overrideDownloadUrlMethod;
return $this->downloadUrlMethod;
}
}

View File

@@ -41,7 +41,7 @@ enum DownloadUrlMethod: string
* external dependencies in Git submodules that otherwise aren't
* included in GitHub/Gitlab/etc "dist" downloads
*/
if ($package->overrideDownloadUrlMethod() === DownloadUrlMethod::PrePackagedSourceDownload) {
if ($package->downloadUrlMethod() === DownloadUrlMethod::PrePackagedSourceDownload) {
return self::PrePackagedSourceDownload;
}

View File

@@ -216,7 +216,7 @@ final class OverrideDownloadUrlInstallListenerTest extends TestCase
$composerPackage->setDistUrl('https://example.com/git-archive-zip-url');
$composerPackage->setPhpExt([
'extension-name' => 'foobar',
'override-download-url-method' => 'pre-packaged-source',
'download-url-method' => 'pre-packaged-source',
]);
/**