File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class OpenStack
2020 private $ builder ;
2121
2222 /**
23- * @param array $options User-defined options
23+ * @param array $options User-defined options
2424 *
2525 * $options['username'] = (string) Your OpenStack username [REQUIRED]
2626 * ['password'] = (string) Your OpenStack password [REQUIRED]
@@ -30,6 +30,9 @@ class OpenStack
3030 * ['debugLog'] = (bool) Whether to enable HTTP logging [OPTIONAL]
3131 * ['logger'] = (LoggerInterface) Must set if debugLog is true [OPTIONAL]
3232 * ['messageFormatter'] = (MessageFormatter) Must set if debugLog is true [OPTIONAL]
33+ * ['requestOption'] = (array) Guzzle Http request options [OPTIONAL]
34+ *
35+ * @param Builder $builder
3336 */
3437 public function __construct (array $ options = [], Builder $ builder = null )
3538 {
@@ -51,10 +54,16 @@ private function getDefaultIdentityService(array $options): Service
5154 throw new \InvalidArgumentException ("'authUrl' is a required option " );
5255 }
5356
54- return Service:: factory ( new Client ( [
57+ $ clientOptions = [
5558 'base_uri ' => Utils::normalizeUrl ($ options ['authUrl ' ]),
5659 'handler ' => HandlerStack::create (),
57- ]));
60+ ];
61+
62+ if (isset ($ options ['requestOptions ' ])) {
63+ $ clientOptions = array_merge ($ options ['requestOptions ' ], $ clientOptions );
64+ }
65+
66+ return Service::factory (new Client ($ clientOptions ));
5867 }
5968
6069 /**
You can’t perform that action at this time.
0 commit comments