From 22c5403e98d6b576dd21e8f7cd919d8a2141b159 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Tue, 17 Mar 2026 12:57:43 +0800 Subject: [PATCH] Allow unstable for PECL downloads --- src/StaticPHP/Artifact/Downloader/Type/PECL.php | 2 +- src/StaticPHP/Config/ConfigValidator.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StaticPHP/Artifact/Downloader/Type/PECL.php b/src/StaticPHP/Artifact/Downloader/Type/PECL.php index 78ceed3a..df2da341 100644 --- a/src/StaticPHP/Artifact/Downloader/Type/PECL.php +++ b/src/StaticPHP/Artifact/Downloader/Type/PECL.php @@ -54,7 +54,7 @@ class PECL implements DownloadTypeInterface, CheckUpdateInterface $versions = []; logger()->debug('Matched ' . count($matches['version']) . " releases for {$name} from PECL"); foreach ($matches['version'] as $i => $version) { - if ($matches['state'][$i] !== 'stable') { + if ($matches['state'][$i] !== 'stable' && ($config['prefer-stable'] ?? true) === true) { continue; } $versions[$version] = $peclName . '-' . $version . '.tgz'; diff --git a/src/StaticPHP/Config/ConfigValidator.php b/src/StaticPHP/Config/ConfigValidator.php index 4a4f75db..256e47fd 100644 --- a/src/StaticPHP/Config/ConfigValidator.php +++ b/src/StaticPHP/Config/ConfigValidator.php @@ -91,7 +91,7 @@ class ConfigValidator 'bitbuckettag' => [['repo'], ['extract']], 'local' => [['dirname'], ['extract']], 'pie' => [['repo'], ['extract']], - 'pecl' => [['name'], ['extract']], + 'pecl' => [['name'], ['extract', 'prefer-stable']], 'php-release' => [['domain'], ['extract']], 'custom' => [[], ['func']], ];