zing / flysystem-oss
Flysystem 的 OSS 文件系统适配器。
3.2.0
2024-03-18 16:03 UTC
Requires
- php: ^8.0
- ext-json: *
- aliyuncs/oss-sdk-php: ^2.4.3
- guzzlehttp/psr7: ^1.7 || ^2.0
- league/flysystem: ^3.10
Requires (Dev)
- league/flysystem-adapter-test-utilities: ^3.7
- mockery/mockery: ~1.3.3 || ^1.4.2
- phpstan/phpstan-mockery: ^1.0
- phpunit/phpunit: ^9.3.3 || ^10.0
- zing/coding-standard: ^6.4 || ^7.0
README
需求
版本信息
使用 Composer 安装 Flysystem OSS
composer require zing/flysystem-oss
使用方法
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);
集成
- Laravel: zing/laravel-flysystem-oss
参考
许可
Flysystem OSS 是一个开源软件,许可协议为 MIT 许可协议。