This commit is contained in:
Javier Casares 2026-06-09 12:52:52 +00:00
commit 19ef0566df
610 changed files with 21958 additions and 3112 deletions

View file

@ -283,6 +283,7 @@ class AwsClient implements AwsClientInterface
$args['with_resolved']($config);
}
$this->addUserAgentMiddleware($config);
$this->addEventStreamHttpFlagMiddleware();
}
public function getHandlerList()
@ -543,7 +544,7 @@ class AwsClient implements AwsClientInterface
{
$list = $this->getHandlerList();
$list->appendBuild(
Middleware::mapRequest(function (RequestInterface $r) {
Middleware::mapRequest(static function (RequestInterface $r) {
return $r->withHeader(
'x-amzn-query-mode',
"true"
@ -649,6 +650,34 @@ class AwsClient implements AwsClientInterface
);
}
/**
* Enables streaming the response by using the stream flag.
*
* @return void
*/
private function addEventStreamHttpFlagMiddleware(): void
{
$api = $this->getApi();
$this->getHandlerList()
-> appendInit(
static function (callable $handler) use ($api) {
return static function (CommandInterface $command, $request = null) use ($handler, $api) {
$operation = $api->getOperation($command->getName());
$output = $operation->getOutput();
foreach ($output->getMembers() as $memberProps) {
if (!empty($memberProps['eventstream'])) {
$command['@http']['stream'] = true;
break;
}
}
return $handler($command, $request);
};
},
'event-streaming-flag-middleware'
);
}
/**
* Retrieves client context param definition from service model,
* creates mapping of client context param names with client-provided
@ -737,29 +766,6 @@ class AwsClient implements AwsClientInterface
return $this->endpointProvider instanceof EndpointProviderV2;
}
public static function emitDeprecationWarning() {
trigger_error(
"This method is deprecated. It will be removed in an upcoming release."
, E_USER_DEPRECATED
);
$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