diff --git a/composer.json b/composer.json index 9106e288f..c7e367216 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,17 @@ } ], "require": { - "php": ">=5.6", + "php": ">=7.2", "pear/net_url2": "^2.2", "pear/mail_mime": "^1.10", "firebase/php-jwt": "^4.0 || ^5.0", - "microsoft/azure-storage": "^0.19.1", - "guzzlehttp/guzzle": "^6.2", - "zendframework/zend-mime": "^2.6", - "zendframework/zend-mail": "^2.7" + "microsoft/azure-storage-blob": "^1.0", + "microsoft/azure-storage-file": "^1.0", + "microsoft/azure-storage-queue": "^1.0", + "microsoft/azure-storage-table": "^1.0", + "guzzlehttp/guzzle": "^6.2 || ^7.0.1", + "laminas/laminas-mime": "^2.6", + "laminas/laminas-mail": "^2.7" }, "require-dev": { "mikey179/vfsStream": "^1.6", diff --git a/src/Common/Internal/Http/HttpClient.php b/src/Common/Internal/Http/HttpClient.php index 6cc5c194b..50f4ea586 100644 --- a/src/Common/Internal/Http/HttpClient.php +++ b/src/Common/Internal/Http/HttpClient.php @@ -99,10 +99,12 @@ class HttpClient implements IHttpClient * * @param string $certificatePath The certificate path * @param string $certificateAuthorityPath The path of the certificate authority + * @param array $options Array of options for guzzle */ public function __construct( $certificatePath = Resources::EMPTY_STRING, - $certificateAuthorityPath = Resources::EMPTY_STRING + $certificateAuthorityPath = Resources::EMPTY_STRING, + $options = array() ) { $this->_config = [ Resources::USE_BRACKETS => true, @@ -127,6 +129,8 @@ public function __construct( $this->_requestUrl = null; $this->_expectedStatusCodes = []; + + $this->_config = array_merge($this->_config, $options); } /** diff --git a/src/Common/ServicesBuilder.php b/src/Common/ServicesBuilder.php index e4bc52097..c633f4af9 100644 --- a/src/Common/ServicesBuilder.php +++ b/src/Common/ServicesBuilder.php @@ -82,11 +82,13 @@ class ServicesBuilder /** * Gets the HTTP client used in the REST services construction. * + * @param array $options Array of options for guzzle + * * @return IHttpClient */ - protected function httpClient() + protected function httpClient($options = array()) { - return new HttpClient(); + return new HttpClient(Resources::EMPTY_STRING, Resources::EMPTY_STRING, $options); } /** @@ -216,13 +218,13 @@ public function createTableService($connectionString) * * @return IServiceBus */ - public function createServiceBusService($connectionString) + public function createServiceBusService($connectionString, $options = array()) { $settings = ServiceBusSettings::createFromConnectionString( $connectionString ); - $httpClient = $this->httpClient(); + $httpClient = $this->httpClient($options); $serializer = $this->serializer(); $serviceBusWrapper = new ServiceBusRestProxy( $httpClient,