installed plugin Infinite Uploads version 2.0.8

This commit is contained in:
2025-05-02 12:03:21 +00:00
committed by Gitium
parent 7ca941b591
commit 8fefb19ab4
1179 changed files with 99739 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace UglyRobot\Infinite_Uploads\Aws\Arn\S3;
use UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArn as BaseAccessPointArn;
use UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArnInterface;
use UglyRobot\Infinite_Uploads\Aws\Arn\ArnInterface;
use UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException;
/**
* @internal
*/
class AccessPointArn extends \UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArn implements \UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArnInterface
{
/**
* Validation specific to AccessPointArn
*
* @param array $data
*/
protected static function validate(array $data)
{
parent::validate($data);
if ($data['service'] !== 's3') {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 3rd component of an S3 access" . " point ARN represents the region and must be 's3'.");
}
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace UglyRobot\Infinite_Uploads\Aws\Arn\S3;
use UglyRobot\Infinite_Uploads\Aws\Arn\ArnInterface;
/**
* @internal
*/
interface BucketArnInterface extends ArnInterface
{
public function getBucketName();
}

View File

@ -0,0 +1,77 @@
<?php
namespace UglyRobot\Infinite_Uploads\Aws\Arn\S3;
use UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArn as BaseAccessPointArn;
use UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArnInterface;
use UglyRobot\Infinite_Uploads\Aws\Arn\Arn;
use UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException;
/**
* This class represents an S3 Outposts access point ARN, which is in the
* following format:
*
* arn:{partition}:s3-outposts:{region}:{accountId}:outpost:{outpostId}:accesspoint:{accesspointName}
*
* ':' and '/' can be used interchangeably as delimiters for components after
* the account ID.
*
* @internal
*/
class OutpostsAccessPointArn extends \UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArn implements \UglyRobot\Infinite_Uploads\Aws\Arn\AccessPointArnInterface, \UglyRobot\Infinite_Uploads\Aws\Arn\S3\OutpostsArnInterface
{
public static function parse($string)
{
$data = parent::parse($string);
return self::parseOutpostData($data);
}
public function getOutpostId()
{
return $this->data['outpost_id'];
}
public function getAccesspointName()
{
return $this->data['accesspoint_name'];
}
private static function parseOutpostData(array $data)
{
$resourceData = preg_split("/[\\/:]/", $data['resource_id']);
$data['outpost_id'] = isset($resourceData[0]) ? $resourceData[0] : null;
$data['accesspoint_type'] = isset($resourceData[1]) ? $resourceData[1] : null;
$data['accesspoint_name'] = isset($resourceData[2]) ? $resourceData[2] : null;
if (isset($resourceData[3])) {
$data['resource_extra'] = implode(':', array_slice($resourceData, 3));
}
return $data;
}
/**
* Validation specific to OutpostsAccessPointArn. Note this uses the base Arn
* class validation instead of the direct parent due to it having slightly
* differing requirements from its parent.
*
* @param array $data
*/
protected static function validate(array $data)
{
\UglyRobot\Infinite_Uploads\Aws\Arn\Arn::validate($data);
if ($data['service'] !== 's3-outposts') {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 3rd component of an S3 Outposts" . " access point ARN represents the service and must be" . " 's3-outposts'.");
}
self::validateRegion($data, 'S3 Outposts access point ARN');
self::validateAccountId($data, 'S3 Outposts access point ARN');
if ($data['resource_type'] !== 'outpost') {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 6th component of an S3 Outposts" . " access point ARN represents the resource type and must be" . " 'outpost'.");
}
if (!self::isValidHostLabel($data['outpost_id'])) {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 7th component of an S3 Outposts" . " access point ARN is required, represents the outpost ID, and" . " must be a valid host label.");
}
if ($data['accesspoint_type'] !== 'accesspoint') {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 8th component of an S3 Outposts" . " access point ARN must be 'accesspoint'");
}
if (!self::isValidHostLabel($data['accesspoint_name'])) {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 9th component of an S3 Outposts" . " access point ARN is required, represents the accesspoint name," . " and must be a valid host label.");
}
if (!empty($data['resource_extra'])) {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("An S3 Outposts access point ARN" . " should only have 9 components, delimited by the characters" . " ':' and '/'. '{$data['resource_extra']}' was found after the" . " 9th component.");
}
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace UglyRobot\Infinite_Uploads\Aws\Arn\S3;
use UglyRobot\Infinite_Uploads\Aws\Arn\ArnInterface;
/**
* @internal
*/
interface OutpostsArnInterface extends ArnInterface
{
public function getOutpostId();
}

View File

@ -0,0 +1,71 @@
<?php
namespace UglyRobot\Infinite_Uploads\Aws\Arn\S3;
use UglyRobot\Infinite_Uploads\Aws\Arn\Arn;
use UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException;
use UglyRobot\Infinite_Uploads\Aws\Arn\ResourceTypeAndIdTrait;
/**
* This class represents an S3 Outposts bucket ARN, which is in the
* following format:
*
* @internal
*/
class OutpostsBucketArn extends \UglyRobot\Infinite_Uploads\Aws\Arn\Arn implements \UglyRobot\Infinite_Uploads\Aws\Arn\S3\BucketArnInterface, \UglyRobot\Infinite_Uploads\Aws\Arn\S3\OutpostsArnInterface
{
use ResourceTypeAndIdTrait;
/**
* Parses a string into an associative array of components that represent
* a OutpostsBucketArn
*
* @param $string
* @return array
*/
public static function parse($string)
{
$data = parent::parse($string);
$data = self::parseResourceTypeAndId($data);
return self::parseOutpostData($data);
}
public function getBucketName()
{
return $this->data['bucket_name'];
}
public function getOutpostId()
{
return $this->data['outpost_id'];
}
private static function parseOutpostData(array $data)
{
$resourceData = preg_split("/[\\/:]/", $data['resource_id'], 3);
$data['outpost_id'] = isset($resourceData[0]) ? $resourceData[0] : null;
$data['bucket_label'] = isset($resourceData[1]) ? $resourceData[1] : null;
$data['bucket_name'] = isset($resourceData[2]) ? $resourceData[2] : null;
return $data;
}
/**
*
* @param array $data
*/
protected static function validate(array $data)
{
\UglyRobot\Infinite_Uploads\Aws\Arn\Arn::validate($data);
if ($data['service'] !== 's3-outposts') {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 3rd component of an S3 Outposts" . " bucket ARN represents the service and must be 's3-outposts'.");
}
self::validateRegion($data, 'S3 Outposts bucket ARN');
self::validateAccountId($data, 'S3 Outposts bucket ARN');
if ($data['resource_type'] !== 'outpost') {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 6th component of an S3 Outposts" . " bucket ARN represents the resource type and must be" . " 'outpost'.");
}
if (!self::isValidHostLabel($data['outpost_id'])) {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 7th component of an S3 Outposts" . " bucket ARN is required, represents the outpost ID, and" . " must be a valid host label.");
}
if ($data['bucket_label'] !== 'bucket') {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 8th component of an S3 Outposts" . " bucket ARN must be 'bucket'");
}
if (empty($data['bucket_name'])) {
throw new \UglyRobot\Infinite_Uploads\Aws\Arn\Exception\InvalidArnException("The 9th component of an S3 Outposts" . " bucket ARN represents the bucket name and must not be empty.");
}
}
}