Coder Social home page Coder Social logo

arraypress / s3-providers Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 120 KB

A comprehensive library facilitating interactions with various S3-compatible storage providers. Supports popular providers like Cloudflare R2, Linode, Amazon, and others.

PHP 100.00%

s3-providers's Introduction

S3 Object Storage Providers & Regions Library

The Providers class offers a seamless integration experience with a range of popular object storage providers. Designed to work hand-in-hand with the s3-signing library, this class provides an effortless mechanism to fetch correct endpoints based on the provider and region, enhancing the power and flexibility of your applications.

Key Features:

  • Extensive Provider Support: This library encompasses a broad array of object storage providers, including AWS, Linode, CloudFlare R2, Wasabi, Backblaze, and DigitalOcean.
  • Dynamic Endpoint Fetching: Automatically retrieve the appropriate endpoints for a chosen provider and region, eliminating manual lookup.
  • Endpoint Verification: Ensure that your endpoints are accurate and up-to-date with the built-in verification system.
  • Flexible Configuration Options: Beyond just regions, the class supports inputs like account IDs, making it adaptable to various use-cases.
  • Retrieve Providers & Regions: Conveniently obtain a list of supported providers and regions, making plugin updates or app extensions a breeze.
  • Region Existence Check: Validate if a specific region exists within a provider, preventing potential errors in applications.
  • Up-to-Date JSON Support: The library sources providers and regions from an up-to-date JSON file. However, for customized needs, users have the flexibility to pass in their own JSON file or a structured PHP array to override default details.

Supported Providers

  • Amazon S3 (AWS)
  • CloudFlare R2
  • DigitalOcean Spaces
  • Linode Object Storage
  • Wasabi Cloud Storage
  • Backblaze B2 Cloud Storage

Minimum Requirements

  • PHP: 7.4 or later

Installation

To integrate the S3 Providers Library into your project, use Composer:

composer require arraypress/s3-providers

Including the Vendor Library

Include the Composer autoloader in your project to access the library:

require_once __DIR__ . '/vendor/autoload.php';

Initialization

Loading providers from a default JSON file:

$registry = new ArrayPress\S3\Registry();

Loading providers from a specific JSON file:

$registry = new ArrayPress\S3\Registry( '/path/to/providers.json' );

Initializing with a predefined array of provider data:

$provider_data = [
    "gcp" => [
        "label" => "Google Cloud Platform",
        //... other provider data, check providers.json for required format
    ]
];
$registry = new ArrayPress\S3\Providers( $provider_data );

Fetching All Providers

$all_providers = $registry->getProviders();

Fetching Provider Options

$all_providers = $registry->getProviderOptions();

Note: More examples will be added soon.

Contributions

Contributions to this library are highly appreciated. Raise issues on GitHub or submit pull requests for bug fixes or new features. Share feedback and suggestions for improvements.

License

This library is licensed under the GNU General Public License v2.0.

s3-providers's People

Contributors

arraypress avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.