buglinjo / flysystem-aws-s3-v3

[READYONLY SUB-SPLIT]Flysystem Adapter for AWS SDK V3

Home Page:https://github.com/thephpleague/flysystem/tree/3.x/src/AwsS3V3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

League\Flysystem\AwsS3V3

Author Build Status Coverage Status Quality Score Software License Packagist Version Total Downloads

This is a Flysystem adapter for the aws-sdk-php v3.

Installation

composer require league/flysystem-aws-s3-v3

Bootstrap

Using standard Aws\S3\S3Client:

<?php
use Aws\S3\S3Client;
use League\Flysystem\AwsS3V3\AwsS3V3Adapter;
use League\Flysystem\Filesystem;

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

$client = new S3Client([
    'credentials' => [
        'key'    => 'your-key',
        'secret' => 'your-secret'
    ],
    'region' => 'your-region',
    'version' => 'latest|version',
]);

$adapter = new AwsS3V3Adapter($client, 'your-bucket-name');
$filesystem = new Filesystem($adapter);

or using Aws\S3\S3MultiRegionClient which does not require to specify the region parameter:

<?php
use Aws\S3\S3MultiRegionClient;
use League\Flysystem\AwsS3V3\AwsS3V3Adapter;
use League\Flysystem\Filesystem;

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

$client = new S3MultiRegionClient([
    'credentials' => [
        'key'    => 'your-key',
        'secret' => 'your-secret'
    ],
    'version' => 'latest|version',
]);

$adapter = new AwsS3V3Adapter($client, 'your-bucket-name');
$filesystem = new Filesystem($adapter);

About

[READYONLY SUB-SPLIT]Flysystem Adapter for AWS SDK V3

https://github.com/thephpleague/flysystem/tree/3.x/src/AwsS3V3

License:MIT License


Languages

Language:PHP 100.0%