mirror of
https://github.com/php-win-ext/php-sdk-binary-tools.git
synced 2026-03-24 17:12:12 +01:00
Compare commits
5 Commits
master
...
php-sdk-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
154b63fb2e | ||
|
|
b9530450e2 | ||
|
|
c74c3b5b94 | ||
|
|
53afca7edb | ||
|
|
96d8b2f49a |
@@ -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?
|
||||
|
||||
@@ -122,6 +122,8 @@ trait FileOps
|
||||
retry:
|
||||
$ch = curl_init();
|
||||
|
||||
echo "CALL $url \n";
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
|
||||
if ($dest_fn) {
|
||||
@@ -131,13 +133,19 @@ retry:
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
//curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
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, ['x-custom-header: top1','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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user