zing/flysystem-oss

OSS filesystem adapter for Flysystem.

3.2.0 2024-03-18 16:03 UTC

README

tests Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

Requires

Version Information

Require Flysystem OSS using Composer:

composer require zing/flysystem-oss

Usage

use League\Flysystem\Filesystem;
use OSS\OssClient;
use Zing\Flysystem\Oss\OssAdapter;

$prefix = '';
$config = [
    'provider' => new StaticCredentialsProvider('aW52YWxpZC1rZXk=', 'aW52YWxpZC1zZWNyZXQ='),
    'bucket' => 'test',
    'endpoint' => 'oss-cn-shanghai.aliyuncs.com',
];

$config['options'] = [
    'url' => '',
    'endpoint' => $config['endpoint'], 
    'bucket_endpoint' => '',
    'temporary_url' => '',
];

$client = new OssClient($config);
$adapter = new OssAdapter($client, $config['bucket'], $prefix, null, null, $config['options']);
$flysystem = new Filesystem($adapter);

Integration

Reference

league/flysystem-aws-s3-v3

License

Flysystem OSS is an open-sourced software licensed under the MIT license.