Adds a new 'S3-Compatible Storage' provider that works with any
S3-API-compatible object storage service, including MinIO, Ceph,
Cloudflare R2, Backblaze B2, and others.
Changes:
- New provider class: classes/providers/storage/s3-compatible-provider.php
- Provider key: s3compatible
- Reads user-configured endpoint URL from settings
- Uses path-style URL access (required by most S3-compatible services)
- Supports credentials via AS3CF_S3COMPAT_ACCESS_KEY_ID /
AS3CF_S3COMPAT_SECRET_ACCESS_KEY wp-config.php constants
- Disables AWS-specific features (Block Public Access, Object Ownership)
- New provider SVG icons (s3compatible.svg, -link.svg, -round.svg)
- Registered provider in main plugin class with endpoint setting support
- Updated StorageProviderSubPage to show endpoint URL input for S3-compatible
- Built pro settings bundle with rollup (Svelte 4.2.19)
- Added package.json and updated rollup.config.mjs for pro-only builds
57 lines
1.6 KiB
PHP
57 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace DeliciousBrains\WP_Offload_Media\Aws3\Aws\Api;
|
|
|
|
/**
|
|
* Base class representing a modeled shape.
|
|
*/
|
|
class Shape extends AbstractModel
|
|
{
|
|
/**
|
|
* Get a concrete shape for the given definition.
|
|
*
|
|
* @param array $definition
|
|
* @param ShapeMap $shapeMap
|
|
*
|
|
* @return mixed
|
|
* @throws \RuntimeException if the type is invalid
|
|
*/
|
|
public static function create(array $definition, ShapeMap $shapeMap)
|
|
{
|
|
static $map = ['structure' => StructureShape::class, 'map' => MapShape::class, 'list' => ListShape::class, 'timestamp' => TimestampShape::class, 'integer' => Shape::class, 'double' => Shape::class, 'float' => Shape::class, 'long' => Shape::class, 'string' => Shape::class, 'byte' => Shape::class, 'character' => Shape::class, 'blob' => Shape::class, 'boolean' => Shape::class];
|
|
if (isset($definition['shape'])) {
|
|
return $shapeMap->resolve($definition);
|
|
}
|
|
if (!isset($map[$definition['type']])) {
|
|
throw new \RuntimeException('Invalid type: ' . \print_r($definition, \true));
|
|
}
|
|
$type = $map[$definition['type']];
|
|
return new $type($definition, $shapeMap);
|
|
}
|
|
/**
|
|
* Get the type of the shape
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getType()
|
|
{
|
|
return $this->definition['type'];
|
|
}
|
|
/**
|
|
* Get the name of the shape
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->definition['name'];
|
|
}
|
|
/**
|
|
* Get a context param definition.
|
|
*/
|
|
public function getContextParam()
|
|
{
|
|
return $this->contextParam;
|
|
}
|
|
}
|