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
79 lines
3.1 KiB
PHP
79 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace DeliciousBrains\WP_Offload_Media\Aws3\GuzzleHttp;
|
|
|
|
use DeliciousBrains\WP_Offload_Media\Aws3\GuzzleHttp\Exception\GuzzleException;
|
|
use DeliciousBrains\WP_Offload_Media\Aws3\GuzzleHttp\Promise\PromiseInterface;
|
|
use DeliciousBrains\WP_Offload_Media\Aws3\Psr\Http\Message\RequestInterface;
|
|
use DeliciousBrains\WP_Offload_Media\Aws3\Psr\Http\Message\ResponseInterface;
|
|
use DeliciousBrains\WP_Offload_Media\Aws3\Psr\Http\Message\UriInterface;
|
|
/**
|
|
* Client interface for sending HTTP requests.
|
|
*/
|
|
interface ClientInterface
|
|
{
|
|
/**
|
|
* The Guzzle major version.
|
|
*/
|
|
public const MAJOR_VERSION = 7;
|
|
/**
|
|
* Send an HTTP request.
|
|
*
|
|
* @param RequestInterface $request Request to send
|
|
* @param array $options Request options to apply to the given
|
|
* request and to the transfer.
|
|
*
|
|
* @throws GuzzleException
|
|
*/
|
|
public function send(RequestInterface $request, array $options = []) : ResponseInterface;
|
|
/**
|
|
* Asynchronously send an HTTP request.
|
|
*
|
|
* @param RequestInterface $request Request to send
|
|
* @param array $options Request options to apply to the given
|
|
* request and to the transfer.
|
|
*/
|
|
public function sendAsync(RequestInterface $request, array $options = []) : PromiseInterface;
|
|
/**
|
|
* Create and send an HTTP request.
|
|
*
|
|
* Use an absolute path to override the base path of the client, or a
|
|
* relative path to append to the base path of the client. The URL can
|
|
* contain the query string as well.
|
|
*
|
|
* @param string $method HTTP method.
|
|
* @param string|UriInterface $uri URI object or string.
|
|
* @param array $options Request options to apply.
|
|
*
|
|
* @throws GuzzleException
|
|
*/
|
|
public function request(string $method, $uri, array $options = []) : ResponseInterface;
|
|
/**
|
|
* Create and send an asynchronous HTTP request.
|
|
*
|
|
* Use an absolute path to override the base path of the client, or a
|
|
* relative path to append to the base path of the client. The URL can
|
|
* contain the query string as well. Use an array to provide a URL
|
|
* template and additional variables to use in the URL template expansion.
|
|
*
|
|
* @param string $method HTTP method
|
|
* @param string|UriInterface $uri URI object or string.
|
|
* @param array $options Request options to apply.
|
|
*/
|
|
public function requestAsync(string $method, $uri, array $options = []) : PromiseInterface;
|
|
/**
|
|
* Get a client configuration option.
|
|
*
|
|
* These options include default request options of the client, a "handler"
|
|
* (if utilized by the concrete client), and a "base_uri" if utilized by
|
|
* the concrete client.
|
|
*
|
|
* @param string|null $option The config option to retrieve.
|
|
*
|
|
* @return mixed
|
|
*
|
|
* @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0.
|
|
*/
|
|
public function getConfig(?string $option = null);
|
|
}
|