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: 5 months ago
JSON representation
Flysystem for Aliyun OSS
- Host: GitHub
- URL: https://github.com/ofcold/flysystem-ali_oss
- Owner: ofcold
- License: mit
- Created: 2018-04-23T03:50:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-23T06:31:04.000Z (almost 8 years ago)
- Last Synced: 2025-01-10T01:37:55.237Z (about 1 year ago)
- Topics: aliyun-oss, flysystem, laravel55, php71, pyrocms3, storage
- Language: PHP
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)