diff options
Diffstat (limited to 'vendor')
| -rw-r--r-- | vendor/edu-sharing-plugin/edu-sharing-auth-helper.php | 6 | ||||
| -rw-r--r-- | vendor/edu-sharing-plugin/edu-sharing-helper-base.php | 7 | ||||
| -rw-r--r-- | vendor/edu-sharing-plugin/edu-sharing-node-helper.php | 11 |
3 files changed, 21 insertions, 3 deletions
diff --git a/vendor/edu-sharing-plugin/edu-sharing-auth-helper.php b/vendor/edu-sharing-plugin/edu-sharing-auth-helper.php index 071c0c6..ef9dec1 100644 --- a/vendor/edu-sharing-plugin/edu-sharing-auth-helper.php +++ b/vendor/edu-sharing-plugin/edu-sharing-auth-helper.php @@ -25,6 +25,9 @@ class EduSharingAuthHelper extends EduSharingHelperAbstract { CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => 5 ]); + if ($this->base->http_proxy) { + curl_setopt($curl, CURLOPT_PROXY, $this->base->http_proxy); + } $data = json_decode(curl_exec($curl), true); curl_close($curl); if ( is_null( $data ) ) { @@ -79,6 +82,9 @@ class EduSharingAuthHelper extends EduSharingHelperAbstract { CURLOPT_POSTFIELDS, is_array($bodyparams) ? json_encode($bodyparams) : (string) $bodyparams ); + if ($this->base->http_proxy) { + curl_setopt($curl, CURLOPT_PROXY, $this->base->http_proxy); + } $output = curl_exec($curl); $data = json_decode($output, true); diff --git a/vendor/edu-sharing-plugin/edu-sharing-helper-base.php b/vendor/edu-sharing-plugin/edu-sharing-helper-base.php index ac3e2f6..4c6f6da 100644 --- a/vendor/edu-sharing-plugin/edu-sharing-helper-base.php +++ b/vendor/edu-sharing-plugin/edu-sharing-helper-base.php @@ -5,6 +5,7 @@ class EduSharingHelperBase { public $privateKey; public $appId; public $language = 'de'; + public $http_proxy = ''; /** * @param string $baseUrl @@ -17,7 +18,8 @@ class EduSharingHelperBase { public function __construct( string $baseUrl, string $privateKey, - string $appId + string $appId, + string $http_proxy = '' ) { if(!preg_match('/^([a-z]|[A-Z]|[0-9]|[-_])+$/', $appId)) { throw new Exception('The given app id contains invalid characters or symbols'); @@ -25,6 +27,7 @@ class EduSharingHelperBase { $this->baseUrl=$baseUrl; $this->privateKey=$privateKey; $this->appId=$appId; + $this->http_proxy = $http_proxy; } public function setLanguage(string $language) { @@ -39,4 +42,4 @@ class EduSharingHelperBase { return $signature; } -}
\ No newline at end of file +} diff --git a/vendor/edu-sharing-plugin/edu-sharing-node-helper.php b/vendor/edu-sharing-plugin/edu-sharing-node-helper.php index 112d7d8..6c7a18e 100644 --- a/vendor/edu-sharing-plugin/edu-sharing-node-helper.php +++ b/vendor/edu-sharing-plugin/edu-sharing-node-helper.php @@ -69,6 +69,9 @@ class EduSharingNodeHelper extends EduSharingHelperAbstract { CURLOPT_RETURNTRANSFER => 1, CURLOPT_HTTPHEADER => $headers ]); + if ($this->base->http_proxy) { + curl_setopt($curl, CURLOPT_PROXY, $this->base->http_proxy); + } $data = json_decode(curl_exec($curl), true); $err = curl_errno( $curl ); $info = curl_getinfo($curl); @@ -127,6 +130,9 @@ class EduSharingNodeHelper extends EduSharingHelperAbstract { CURLOPT_RETURNTRANSFER => 1, CURLOPT_HTTPHEADER => $headers ]); + if ($this->base->http_proxy) { + curl_setopt($curl, CURLOPT_PROXY, $this->base->http_proxy); + } $data = json_decode(curl_exec($curl), true); $err = curl_errno( $curl ); $info = curl_getinfo($curl); @@ -160,6 +166,9 @@ class EduSharingNodeHelper extends EduSharingHelperAbstract { CURLOPT_RETURNTRANSFER => 1, CURLOPT_HTTPHEADER => $headers ]); + if ($this->base->http_proxy) { + curl_setopt($curl, CURLOPT_PROXY, $this->base->http_proxy); + } $data = json_decode(curl_exec($curl), true); $err = curl_errno( $curl ); $info = curl_getinfo($curl); @@ -172,4 +181,4 @@ class EduSharingNodeHelper extends EduSharingHelperAbstract { } } -}
\ No newline at end of file +} |
