huiwang / flysystem-oss
flysystem adapter for the aliyun oss storage
1.0.1
2020-05-18 13:13 UTC
Requires
- php: >=7.1
- aliyuncs/oss-sdk-php: ~2.0
- league/flysystem: ^1.0
Requires (Dev)
- mockery/mockery: ^1.3
- phpunit/phpunit: ~7
This package is auto-updated.
Last update: 2024-04-30 00:45:31 UTC
README
💾 Flysystem adapter for the aliyun oss storage
安装
composer require "huiwang/flysystem-oss" -vvv
使用
$accessKeyId = '';
$accessKeySecret = '';
$endpoint = '';
$bucket = '';
$client = new \OSS\OssClient($accessKeyId, $accessKeySecret, $endpoint);
$adapter = new \Huiwang\Flysystem\Oss\OssAdapter($client, $bucket);
$filesystem = new \League\Flysystem\Filesystem($adapter, ['disable_asserts' => true]);
$filesystem->addPlugin(new \Huiwang\Flysystem\Oss\Plugins\FileUrl());
$filesystem->addPlugin(new \Huiwang\Flysystem\Oss\Plugins\TemporaryUrl());