zing/flysystem-obs

Flysystem adapter for the OBS SDK

2.4.2 2022-01-21 10:25 UTC

README

Build Status Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

Requires PHP 7.2.0+

Require Flysystem OBS using Composer:

composer require zing/flysystem-obs

Usage

use League\Flysystem\Filesystem;
use Obs\ObsClient;
use Zing\Flysystem\Obs\ObsAdapter;

$prefix = '';
$config = [
    'key' => 'aW52YWxpZC1rZXk=',
    'secret' => 'aW52YWxpZC1zZWNyZXQ=',
    'bucket' => 'test',
    'endpoint' => 'obs.cn-east-3.myhuaweicloud.com',
];

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

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

Reference

league/flysystem-aws-s3-v3

iidestiny/flysystem-oss

License

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