Compare commits

...

3 Commits

Author SHA1 Message Date
Jean-Baptiste Nahan
c74c3b5b94 add log 2024-11-12 23:12:24 +01:00
Jean-Baptiste Nahan
53afca7edb Add header if API_TOKEN is present 2024-11-12 22:59:25 +01:00
Jean-Baptiste Nahan
96d8b2f49a change hostname and url to download in Config.php 2024-11-12 21:56:35 +01:00
2 changed files with 8 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ class Config
/* Config variables. */
/** @var string */
protected static $depsHost = 'downloads.php.net';
protected static $depsHost = 'phpext.phptools.online';
/** @var int */
protected static $depsPort = 443;
@@ -18,7 +18,7 @@ class Config
protected static $depsUriScheme = "https";
/** @var string */
protected static $depsBaseUri = "/~windows/php-sdk/deps";
protected static $depsBaseUri = "/api/downloadable/download";
/** @var string */
protected static $sdkNugetFeedUrl = "http://127.0.0.1/sdk/nuget"; // experimental?

View File

@@ -138,6 +138,12 @@ retry:
curl_setopt($ch, CURLOPT_USERAGENT, Config::getSdkUserAgentName());
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$token = getenv('API_TOKEN');
if (!empty($token)) {
echo "**** define authorization header ! ****\n";
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer '.$token]);
}
// workaround for <https://github.com/microsoft/php-sdk-binary-tools/issues/69>
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);