X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/vendor/aws/aws-sdk-php/src
home
/
gfecatvj
/
sites
/
restate
/
vendor
/
aws
/
aws-sdk-php
/
src
/
📁
..
📁
ACMPCA
📄
AbstractConfigurationProvider.php
(4.46 KB)
📁
AccessAnalyzer
📁
Acm
📁
AlexaForBusiness
📁
Amplify
📁
Api
📁
ApiGateway
📁
ApiGatewayManagementApi
📁
ApiGatewayV2
📁
AppConfig
📁
AppMesh
📁
AppSync
📁
ApplicationAutoScaling
📁
ApplicationDiscoveryService
📁
ApplicationInsights
📁
Appstream
📁
Arn
📁
Athena
📁
AugmentedAIRuntime
📁
AutoScaling
📁
AutoScalingPlans
📄
AwsClient.php
(17.21 KB)
📄
AwsClientInterface.php
(5.4 KB)
📄
AwsClientTrait.php
(2.67 KB)
📁
Backup
📁
Batch
📁
Budgets
📄
CacheInterface.php
(755 B)
📁
Chime
📄
ClientResolver.php
(34.92 KB)
📁
ClientSideMonitoring
📁
Cloud9
📁
CloudDirectory
📁
CloudFormation
📁
CloudFront
📁
CloudHSMV2
📁
CloudHsm
📁
CloudSearch
📁
CloudSearchDomain
📁
CloudTrail
📁
CloudWatch
📁
CloudWatchEvents
📁
CloudWatchLogs
📁
CodeArtifact
📁
CodeBuild
📁
CodeCommit
📁
CodeDeploy
📁
CodeGuruProfiler
📁
CodeGuruReviewer
📁
CodePipeline
📁
CodeStar
📁
CodeStarNotifications
📁
CodeStarconnections
📁
CognitoIdentity
📁
CognitoIdentityProvider
📁
CognitoSync
📄
Command.php
(1.39 KB)
📄
CommandInterface.php
(946 B)
📄
CommandPool.php
(5.2 KB)
📁
Comprehend
📁
ComprehendMedical
📁
ComputeOptimizer
📁
ConfigService
📄
ConfigurationProviderInterface.php
(246 B)
📁
Connect
📁
ConnectParticipant
📁
CostExplorer
📁
CostandUsageReportService
📁
Credentials
📁
Crypto
📁
DAX
📁
DLM
📁
DataExchange
📁
DataPipeline
📁
DataSync
📁
DatabaseMigrationService
📁
Detective
📁
DeviceFarm
📁
DirectConnect
📁
DirectoryService
📁
DocDB
📄
DoctrineCacheAdapter.php
(989 B)
📁
DynamoDb
📁
DynamoDbStreams
📁
EBS
📁
EC2InstanceConnect
📁
EKS
📁
Ec2
📁
Ecr
📁
Ecs
📁
Efs
📁
ElastiCache
📁
ElasticBeanstalk
📁
ElasticInference
📁
ElasticLoadBalancing
📁
ElasticLoadBalancingV2
📁
ElasticTranscoder
📁
ElasticsearchService
📁
Emr
📁
Endpoint
📁
EndpointDiscovery
📄
EndpointParameterMiddleware.php
(2.73 KB)
📁
EventBridge
📁
Exception
📁
FMS
📁
FSx
📁
Firehose
📁
ForecastQueryService
📁
ForecastService
📁
FraudDetector
📁
GameLift
📁
Glacier
📁
GlobalAccelerator
📁
Glue
📁
Greengrass
📁
GroundStation
📁
GuardDuty
📁
Handler
📄
HandlerList.php
(13.18 KB)
📄
HasDataTrait.php
(1.11 KB)
📄
HasMonitoringEventsTrait.php
(869 B)
📄
HashInterface.php
(531 B)
📄
HashingStream.php
(1.5 KB)
📁
Health
📄
History.php
(3.81 KB)
📁
Honeycode
📁
IVS
📁
Iam
📄
IdempotencyTokenMiddleware.php
(3.69 KB)
📁
ImportExport
📁
Inspector
📁
IoT1ClickDevicesService
📁
IoT1ClickProjects
📁
IoTAnalytics
📁
IoTEvents
📁
IoTEventsData
📁
IoTJobsDataPlane
📁
IoTSecureTunneling
📁
IoTSiteWise
📁
IoTThingsGraph
📁
Iot
📁
IotDataPlane
📄
JsonCompiler.php
(478 B)
📁
Kafka
📁
Kinesis
📁
KinesisAnalytics
📁
KinesisAnalyticsV2
📁
KinesisVideo
📁
KinesisVideoArchivedMedia
📁
KinesisVideoMedia
📁
KinesisVideoSignalingChannels
📁
Kms
📁
LakeFormation
📁
Lambda
📁
LexModelBuildingService
📁
LexRuntimeService
📁
LicenseManager
📁
Lightsail
📄
LruArrayCache.php
(2.16 KB)
📁
MQ
📁
MTurk
📁
MachineLearning
📁
Macie
📁
Macie2
📁
ManagedBlockchain
📁
MarketplaceCatalog
📁
MarketplaceCommerceAnalytics
📁
MarketplaceEntitlementService
📁
MarketplaceMetering
📁
MediaConnect
📁
MediaConvert
📁
MediaLive
📁
MediaPackage
📁
MediaPackageVod
📁
MediaStore
📁
MediaStoreData
📁
MediaTailor
📄
Middleware.php
(12.76 KB)
📁
MigrationHub
📁
MigrationHubConfig
📁
Mobile
📄
MockHandler.php
(4.02 KB)
📄
MonitoringEventsInterface.php
(742 B)
📄
MultiRegionClient.php
(7.75 KB)
📁
Multipart
📁
Neptune
📁
NetworkManager
📁
OpsWorks
📁
OpsWorksCM
📁
Organizations
📁
Outposts
📁
PI
📁
Personalize
📁
PersonalizeEvents
📁
PersonalizeRuntime
📄
PhpHash.php
(1.81 KB)
📁
Pinpoint
📁
PinpointEmail
📁
PinpointSMSVoice
📁
Polly
📄
PresignUrlMiddleware.php
(3.28 KB)
📁
Pricing
📄
Psr16CacheAdapter.php
(572 B)
📄
PsrCacheAdapter.php
(742 B)
📁
QLDB
📁
QLDBSession
📁
QuickSight
📁
RAM
📁
RDSDataService
📁
Rds
📁
Redshift
📁
Rekognition
📁
ResourceGroups
📁
ResourceGroupsTaggingAPI
📄
ResponseContainerInterface.php
(246 B)
📄
Result.php
(1.14 KB)
📄
ResultInterface.php
(1.34 KB)
📄
ResultPaginator.php
(5.09 KB)
📁
Retry
📄
RetryMiddleware.php
(8.46 KB)
📄
RetryMiddlewareV2.php
(11.66 KB)
📁
RoboMaker
📁
Route53
📁
Route53Domains
📁
Route53Resolver
📁
S3
📁
S3Control
📁
SSO
📁
SSOOIDC
📁
SageMaker
📁
SageMakerRuntime
📁
SavingsPlans
📁
Schemas
📄
Sdk.php
(39.34 KB)
📁
SecretsManager
📁
SecurityHub
📁
ServerlessApplicationRepository
📁
ServiceCatalog
📁
ServiceDiscovery
📁
ServiceQuotas
📁
Ses
📁
SesV2
📁
Sfn
📁
Shield
📁
Signature
📁
Sms
📁
SnowBall
📁
Sns
📁
Sqs
📁
Ssm
📁
StorageGateway
📄
StreamRequestPayloadMiddleware.php
(2.57 KB)
📁
Sts
📁
Support
📁
Swf
📁
Synthetics
📁
Textract
📄
TraceMiddleware.php
(10.72 KB)
📁
TranscribeService
📁
Transfer
📁
Translate
📁
WAFV2
📁
Waf
📁
WafRegional
📄
Waiter.php
(8.32 KB)
📁
WorkDocs
📁
WorkLink
📁
WorkMail
📁
WorkMailMessageFlow
📁
WorkSpaces
📄
WrappedHttpHandler.php
(6.96 KB)
📁
XRay
📁
data
📄
functions.php
(12.93 KB)
📁
imagebuilder
📁
kendra
📁
signer
Editing: RetryMiddleware.php
<?php namespace Aws; use Aws\Exception\AwsException; use Aws\Retry\RetryHelperTrait; use GuzzleHttp\Exception\RequestException; use Psr\Http\Message\RequestInterface; use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Promise; /** * Middleware that retries failures. V1 implemention that supports 'legacy' mode. * * @internal */ class RetryMiddleware { use RetryHelperTrait; private static $retryStatusCodes = [ 500 => true, 502 => true, 503 => true, 504 => true ]; private static $retryCodes = [ // Throttling error 'RequestLimitExceeded' => true, 'Throttling' => true, 'ThrottlingException' => true, 'ThrottledException' => true, 'ProvisionedThroughputExceededException' => true, 'RequestThrottled' => true, 'BandwidthLimitExceeded' => true, 'RequestThrottledException' => true, 'TooManyRequestsException' => true, 'IDPCommunicationError' => true, 'EC2ThrottledException' => true, ]; private $decider; private $delay; private $nextHandler; private $collectStats; public function __construct( callable $decider, callable $delay, callable $nextHandler, $collectStats = false ) { $this->decider = $decider; $this->delay = $delay; $this->nextHandler = $nextHandler; $this->collectStats = (bool) $collectStats; } /** * Creates a default AWS retry decider function. * * The optional $extraConfig parameter is an associative array * that specifies additional retry conditions on top of the ones specified * by default by the Aws\RetryMiddleware class, with the following keys: * * - errorCodes: (string[]) An indexed array of AWS exception codes to retry. * Optional. * - statusCodes: (int[]) An indexed array of HTTP status codes to retry. * Optional. * - curlErrors: (int[]) An indexed array of Curl error codes to retry. Note * these should be valid Curl constants. Optional. * * @param int $maxRetries * @param array $extraConfig * @return callable */ public static function createDefaultDecider( $maxRetries = 3, $extraConfig = [] ) { $retryCurlErrors = []; if (extension_loaded('curl')) { $retryCurlErrors[CURLE_RECV_ERROR] = true; } return function ( $retries, CommandInterface $command, RequestInterface $request, ResultInterface $result = null, $error = null ) use ($maxRetries, $retryCurlErrors, $extraConfig) { // Allow command-level options to override this value $maxRetries = null !== $command['@retries'] ? $command['@retries'] : $maxRetries; $isRetryable = self::isRetryable( $result, $error, $retryCurlErrors, $extraConfig ); if ($retries >= $maxRetries) { if (!empty($error) && $error instanceof AwsException && $isRetryable ) { $error->setMaxRetriesExceeded(); } return false; } return $isRetryable; }; } private static function isRetryable( $result, $error, $retryCurlErrors, $extraConfig = [] ) { $errorCodes = self::$retryCodes; if (!empty($extraConfig['error_codes']) && is_array($extraConfig['error_codes']) ) { foreach($extraConfig['error_codes'] as $code) { $errorCodes[$code] = true; } } $statusCodes = self::$retryStatusCodes; if (!empty($extraConfig['status_codes']) && is_array($extraConfig['status_codes']) ) { foreach($extraConfig['status_codes'] as $code) { $statusCodes[$code] = true; } } if (!empty($extraConfig['curl_errors']) && is_array($extraConfig['curl_errors']) ) { foreach($extraConfig['curl_errors'] as $code) { $retryCurlErrors[$code] = true; } } if (!$error) { if (!isset($result['@metadata']['statusCode'])) { return false; } return isset($statusCodes[$result['@metadata']['statusCode']]); } if (!($error instanceof AwsException)) { return false; } if ($error->isConnectionError()) { return true; } if (isset($errorCodes[$error->getAwsErrorCode()])) { return true; } if (isset($statusCodes[$error->getStatusCode()])) { return true; } if (count($retryCurlErrors) && ($previous = $error->getPrevious()) && $previous instanceof RequestException ) { if (method_exists($previous, 'getHandlerContext')) { $context = $previous->getHandlerContext(); return !empty($context['errno']) && isset($retryCurlErrors[$context['errno']]); } $message = $previous->getMessage(); foreach (array_keys($retryCurlErrors) as $curlError) { if (strpos($message, 'cURL error ' . $curlError . ':') === 0) { return true; } } } return false; } /** * Delay function that calculates an exponential delay. * * Exponential backoff with jitter, 100ms base, 20 sec ceiling * * @param $retries - The number of retries that have already been attempted * * @return int * * @link https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ */ public static function exponentialDelay($retries) { return mt_rand(0, (int) min(20000, (int) pow(2, $retries) * 100)); } /** * @param CommandInterface $command * @param RequestInterface $request * * @return PromiseInterface */ public function __invoke( CommandInterface $command, RequestInterface $request = null ) { $retries = 0; $requestStats = []; $monitoringEvents = []; $handler = $this->nextHandler; $decider = $this->decider; $delay = $this->delay; $request = $this->addRetryHeader($request, 0, 0); $g = function ($value) use ( $handler, $decider, $delay, $command, $request, &$retries, &$requestStats, &$monitoringEvents, &$g ) { $this->updateHttpStats($value, $requestStats); if ($value instanceof MonitoringEventsInterface) { $reversedEvents = array_reverse($monitoringEvents); $monitoringEvents = array_merge($monitoringEvents, $value->getMonitoringEvents()); foreach ($reversedEvents as $event) { $value->prependMonitoringEvent($event); } } if ($value instanceof \Exception || $value instanceof \Throwable) { if (!$decider($retries, $command, $request, null, $value)) { return Promise\rejection_for( $this->bindStatsToReturn($value, $requestStats) ); } } elseif ($value instanceof ResultInterface && !$decider($retries, $command, $request, $value, null) ) { return $this->bindStatsToReturn($value, $requestStats); } // Delay fn is called with 0, 1, ... so increment after the call. $delayBy = $delay($retries++); $command['@http']['delay'] = $delayBy; if ($this->collectStats) { $this->updateStats($retries, $delayBy, $requestStats); } // Update retry header with retry count and delayBy $request = $this->addRetryHeader($request, $retries, $delayBy); return $handler($command, $request)->then($g, $g); }; return $handler($command, $request)->then($g, $g); } }
Upload File
Create Folder