allow downloading multiple php versions

This commit is contained in:
henderkes
2026-01-01 13:56:01 +01:00
parent 64f7a3553e
commit 3c0cc5bd86
6 changed files with 110 additions and 21 deletions

View File

@@ -160,7 +160,7 @@ abstract class BuilderBase
}
if (!$skip_extract) {
$this->emitPatchPoint('before-php-extract');
SourceManager::initSource(sources: ['php-src'], source_only: true);
SourceManager::initSource(sources: [$this->getPhpSrcName()], source_only: true);
$this->emitPatchPoint('after-php-extract');
if ($this->getPHPVersionID() >= 80000) {
$this->emitPatchPoint('before-micro-extract');
@@ -319,7 +319,7 @@ abstract class BuilderBase
public function getPHPVersionFromArchive(?string $file = null): false|string
{
if ($file === null) {
$lock = LockFile::get('php-src');
$lock = LockFile::get($this->getPhpSrcName());
if ($lock === null) {
return false;
}
@@ -498,6 +498,14 @@ abstract class BuilderBase
}
}
/**
* Get the php-src name to use for lock file lookups (supports version-specific names like php-src-8.2)
*/
protected function getPhpSrcName(): string
{
return getenv('SPC_PHP_SRC_NAME') ?: 'php-src';
}
/**
* Generate micro extension test php code.
*/