Skip to content

Commit 1357990

Browse files
committed
Add github token hook for curlExec
1 parent 61a9264 commit 1357990

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use SPC\exception\RuntimeException;
1313
use SPC\exception\WrongUsageException;
1414
use SPC\store\Config;
15+
use SPC\store\CurlHook;
1516
use SPC\store\Downloader;
1617
use SPC\store\FileSystem;
1718
use SPC\util\DependencyUtil;
@@ -324,7 +325,7 @@ protected function buildFrankenphp(): void
324325
$xcaddyModules = str_replace('--with github.com/dunglas/caddy-cbrotli', '', $xcaddyModules);
325326
}
326327
$lrt = PHP_OS_FAMILY === 'Linux' ? '-lrt' : '';
327-
$releaseInfo = json_decode(Downloader::curlExec('https://api.github.com/repos/php/frankenphp/releases/latest', retries: 3), true);
328+
$releaseInfo = json_decode(Downloader::curlExec('https://api.github.com/repos/php/frankenphp/releases/latest', retries: 3, hooks: [[CurlHook::class, 'setupGithubToken']]), true);
328329
$frankenPhpVersion = $releaseInfo['tag_name'];
329330
$libphpVersion = $this->getPHPVersion();
330331
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {

0 commit comments

Comments
 (0)