Server IP : 184.154.167.98 / Your IP : 3.145.112.33 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/www/sesiones/3rdparty/aws/aws-sdk-php/src/Endpoint/ |
Upload File : |
<?php namespace Aws\Endpoint; /** * Provides endpoints based on an endpoint pattern configuration array. */ class PatternEndpointProvider { /** @var array */ private $patterns; /** * @param array $patterns Hash of endpoint patterns mapping to endpoint * configurations. */ public function __construct(array $patterns) { $this->patterns = $patterns; } public function __invoke(array $args = []) { $service = isset($args['service']) ? $args['service'] : ''; $region = isset($args['region']) ? $args['region'] : ''; $keys = ["{$region}/{$service}", "{$region}/*", "*/{$service}", "*/*"]; foreach ($keys as $key) { if (isset($this->patterns[$key])) { return $this->expand( $this->patterns[$key], isset($args['scheme']) ? $args['scheme'] : 'https', $service, $region ); } } return null; } private function expand(array $config, $scheme, $service, $region) { $config['endpoint'] = $scheme . '://' . strtr($config['endpoint'], [ '{service}' => $service, '{region}' => $region ]); return $config; } }