File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 2525 }
2626 ],
2727 "require" : {
28- "php-opencloud/common" : " ~ 1.0"
28+ "php-opencloud/common" : " ^ 1.0.5 "
2929 },
3030 "require-dev" : {
3131 "phpunit/phpunit" : " ~4.0" ,
3232 "sami/sami" : " dev-master" ,
3333 "psr/log" : " ~1.0" ,
3434 "satooshi/php-coveralls" : " ~1.0" ,
3535 "jakub-onderka/php-parallel-lint" : " 0.*" ,
36- "fabpot /php-cs-fixer" : " ~ 1.0"
36+ "friendsofphp /php-cs-fixer" : " ^ 1.0"
3737 }
3838}
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+ * ['requestOptions'] = (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