Skip to content

Commit 681b595

Browse files
committed
allow passing of options to guzzle
1 parent 183619e commit 681b595

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/OpencastApi/Rest/OcRestClient.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class OcRestClient extends Client
1818
private $noHeader = false;
1919
private $origin;
2020
private $features = [];
21+
private $global_options = [];
22+
2123
/*
2224
$config = [
2325
'url' => 'https://develop.opencast.org/', // The API url of the opencast instance (required)
@@ -58,6 +60,8 @@ public function __construct($config)
5860
$this->features = $config['features'];
5961
}
6062

63+
$this->global_options = $config['guzzle'] ?: [];
64+
6165
parent::__construct($parentConstructorConfig);
6266
}
6367

@@ -101,6 +105,7 @@ public function setRequestConnectionTimeout($connectionTimeout)
101105

102106
private function addRequestOptions($uri, $options)
103107
{
108+
$globalOptions = $this->global_options;
104109

105110
// Perform a temp no header request.
106111
if ($this->noHeader) {
@@ -150,7 +155,7 @@ private function addRequestOptions($uri, $options)
150155
}
151156
}
152157

153-
$requestOptions = array_merge($generalOptions, $options);
158+
$requestOptions = array_merge($generalOptions, $globalOptions, $options);
154159
return $requestOptions;
155160
}
156161

0 commit comments

Comments
 (0)