summaryrefslogtreecommitdiff
path: root/vendor/aws/aws-sdk-php/src/AwsClient.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/aws/aws-sdk-php/src/AwsClient.php')
-rw-r--r--vendor/aws/aws-sdk-php/src/AwsClient.php41
1 files changed, 34 insertions, 7 deletions
diff --git a/vendor/aws/aws-sdk-php/src/AwsClient.php b/vendor/aws/aws-sdk-php/src/AwsClient.php
index ac40738..3b43b82 100644
--- a/vendor/aws/aws-sdk-php/src/AwsClient.php
+++ b/vendor/aws/aws-sdk-php/src/AwsClient.php
@@ -4,11 +4,9 @@ namespace Aws;
use Aws\Api\ApiProvider;
use Aws\Api\DocModel;
use Aws\Api\Service;
-use Aws\ClientSideMonitoring\ApiCallAttemptMonitoringMiddleware;
-use Aws\ClientSideMonitoring\ApiCallMonitoringMiddleware;
-use Aws\ClientSideMonitoring\ConfigurationProvider;
use Aws\EndpointDiscovery\EndpointDiscoveryMiddleware;
use Aws\EndpointV2\EndpointProviderV2;
+use Aws\Exception\AwsException;
use Aws\Signature\SignatureProvider;
use GuzzleHttp\Psr7\Uri;
@@ -237,9 +235,8 @@ class AwsClient implements AwsClientInterface
$this->addSignatureMiddleware();
$this->addInvocationId();
$this->addEndpointParameterMiddleware($args);
- if (!$this->isUseEndpointV2()) {
- $this->addEndpointDiscoveryMiddleware($config, $args);
- }
+ $this->addEndpointDiscoveryMiddleware($config, $args);
+ $this->addRequestCompressionMiddleware($config);
$this->loadAliases();
$this->addStreamRequestPayload();
$this->addRecursionDetection();
@@ -359,7 +356,7 @@ class AwsClient implements AwsClientInterface
$klass = get_class($this);
if ($klass === __CLASS__) {
- return ['', 'Aws\Exception\AwsException'];
+ return ['', AwsException::class];
}
$service = substr($klass, strrpos($klass, '\\') + 1, -6);
@@ -449,6 +446,17 @@ class AwsClient implements AwsClientInterface
);
}
+ private function addRequestCompressionMiddleware($config)
+ {
+ if (empty($config['disable_request_compression'])) {
+ $list = $this->getHandlerList();
+ $list->appendBuild(
+ RequestCompressionMiddleware::wrap($config),
+ 'request-compression'
+ );
+ }
+ }
+
private function addInvocationId()
{
// Add invocation id to each request
@@ -593,6 +601,25 @@ class AwsClient implements AwsClientInterface
return $this->endpointProvider instanceof EndpointProviderV2;
}
+ public static function emitDeprecationWarning() {
+ $phpVersion = PHP_VERSION_ID;
+ if ($phpVersion < 70205) {
+ $phpVersionString = phpversion();
+ @trigger_error(
+ "This installation of the SDK is using PHP version"
+ . " {$phpVersionString}, which will be deprecated on August"
+ . " 15th, 2023. Please upgrade your PHP version to a minimum of"
+ . " 7.2.5 before then to continue receiving updates to the AWS"
+ . " SDK for PHP. To disable this warning, set"
+ . " suppress_php_deprecation_warning to true on the client constructor"
+ . " or set the environment variable AWS_SUPPRESS_PHP_DEPRECATION_WARNING"
+ . " to true.",
+ E_USER_DEPRECATED
+ );
+ }
+ }
+
+
/**
* Returns a service model and doc model with any necessary changes
* applied.