Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ofcold/flysystem-ali_oss

Flysystem for Aliyun OSS
https://github.com/ofcold/flysystem-ali_oss

aliyun-oss flysystem laravel55 php71 pyrocms3 storage

Last synced: about 1 month ago
JSON representation

Flysystem for Aliyun OSS

Awesome Lists containing this project

README

        

# flysystem-ali_oss
AliYun OSS Storage adapter for flysystem.

## Installation
```bash
composer require ofcold/flysystem-ali_oss
```

## Usage

- Laravel Or pyrocms
```php

use League\Flysystem\Filesystem;
use League\Flysystem\MountManager;
use Illuminate\Filesystem\FilesystemManager;

$driver = new Filesystem(new OssAdapter(
new OssClient(
'key',
'secret',
'endpoint'
),
'bucket',
'endpoint',
'Your prefix'
));

app(MountManager::class)->mountFilesystem($prefix, $driver);

app(FilesystemManager::class)->extend(
$this->disk->getSlug(),
function () use ($driver) {
return $driver;
}
);
```

## Reference
- [http://flysystem.thephpleague.com/api/](http://flysystem.thephpleague.com/api/)
- [https://github.com/thephpleague/flysystem](https://github.com/thephpleague/flysystem)
- [https://help.aliyun.com/document_detail/32099.html](https://help.aliyun.com/document_detail/32099.html)