From 1357990c4cf110a69c6e5e21ac1730a7559e0908 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 19 Jun 2025 12:51:00 +0800 Subject: [PATCH] Add github token hook for curlExec --- src/SPC/builder/unix/UnixBuilderBase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/unix/UnixBuilderBase.php b/src/SPC/builder/unix/UnixBuilderBase.php index 4232ef91..d88605ae 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -12,6 +12,7 @@ use SPC\exception\FileSystemException; use SPC\exception\RuntimeException; use SPC\exception\WrongUsageException; use SPC\store\Config; +use SPC\store\CurlHook; use SPC\store\Downloader; use SPC\store\FileSystem; use SPC\util\DependencyUtil; @@ -324,7 +325,7 @@ abstract class UnixBuilderBase extends BuilderBase $xcaddyModules = str_replace('--with github.com/dunglas/caddy-cbrotli', '', $xcaddyModules); } $lrt = PHP_OS_FAMILY === 'Linux' ? '-lrt' : ''; - $releaseInfo = json_decode(Downloader::curlExec('https://api.github.com/repos/php/frankenphp/releases/latest', retries: 3), true); + $releaseInfo = json_decode(Downloader::curlExec('https://api.github.com/repos/php/frankenphp/releases/latest', retries: 3, hooks: [[CurlHook::class, 'setupGithubToken']]), true); $frankenPhpVersion = $releaseInfo['tag_name']; $libphpVersion = $this->getPHPVersion(); if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {