From 654e979d0dc12078d2c7c0d881a8222d6faa32c8 Mon Sep 17 00:00:00 2001 From: Patrick O'Connell Date: Tue, 30 Jan 2018 13:25:40 +1100 Subject: [PATCH 1/2] Added the ability to set options for guzzle --- src/Common/Internal/Http/HttpClient.php | 6 +++++- src/Common/ServicesBuilder.php | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) 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, From c97fdb0c754bab83af947cd3ea1babc8fc6d07ed Mon Sep 17 00:00:00 2001 From: Patrick O'Connell Date: Wed, 10 Aug 2022 10:36:14 +1000 Subject: [PATCH 2/2] Updated composer packages for PHP 7.2+ --- composer.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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",