S3UriParser
in package
Extracts a region, bucket, key, and and if a URI is in path-style
Table of Contents
- $defaultResult : mixed
- $pattern : mixed
- $streamWrapperScheme : mixed
- parse() : array<string|int, mixed>
- Parses a URL or S3 StreamWrapper Uri (s3://) into an associative array of Amazon S3 data including:
- parseCustomEndpoint() : mixed
- parsePathStyle() : mixed
- parseS3UrlComponents() : mixed
- parseStreamWrapper() : mixed
- parseVirtualHosted() : mixed
Properties
$defaultResult
private
static mixed
$defaultResult
= ['path_style' => true, 'bucket' => null, 'key' => null, 'region' => null]
$pattern
private
mixed
$pattern
= '/^(.+\.)?s3[.-]([A-Za-z0-9-]+)\./'
$streamWrapperScheme
private
mixed
$streamWrapperScheme
= 's3'
Methods
parse()
Parses a URL or S3 StreamWrapper Uri (s3://) into an associative array of Amazon S3 data including:
public
parse(string|UriInterface $uri) : array<string|int, mixed>
- bucket: The Amazon S3 bucket (null if none)
- key: The Amazon S3 key (null if none)
- path_style: Set to true if using path style, or false if not
- region: Set to a string if a non-class endpoint is used or null.
Parameters
- $uri : string|UriInterface
Tags
Return values
array<string|int, mixed> —parseCustomEndpoint()
private
parseCustomEndpoint(UriInterface $url) : mixed
Parameters
- $url : UriInterface
Return values
mixed —parsePathStyle()
private
parsePathStyle(UriInterface $url) : mixed
Parameters
- $url : UriInterface
Return values
mixed —parseS3UrlComponents()
private
parseS3UrlComponents(mixed $uri) : mixed
Parameters
- $uri : mixed
Return values
mixed —parseStreamWrapper()
private
parseStreamWrapper(UriInterface $url) : mixed
Parameters
- $url : UriInterface
Return values
mixed —parseVirtualHosted()
private
parseVirtualHosted(UriInterface $url, array<string|int, mixed> $matches) : mixed
Parameters
- $url : UriInterface
- $matches : array<string|int, mixed>