Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apollopy/flysystem-aliyun-oss
This is a Flysystem adapter for the Aliyun OSS
https://github.com/apollopy/flysystem-aliyun-oss
aliyun-oss flysystem-adapter laravel php
Last synced: 8 days ago
JSON representation
This is a Flysystem adapter for the Aliyun OSS
- Host: GitHub
- URL: https://github.com/apollopy/flysystem-aliyun-oss
- Owner: apollopy
- License: mit
- Created: 2016-01-18T09:56:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-19T08:45:09.000Z (almost 5 years ago)
- Last Synced: 2024-10-15T09:27:14.509Z (24 days ago)
- Topics: aliyun-oss, flysystem-adapter, laravel, php
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 90
- Watchers: 3
- Forks: 22
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Flysystem Adapter for Aliyun OSS.
This is a Flysystem adapter for the Aliyun OSS ~2.3
inspire by [aobozhang/aliyun-oss-adapter](https://github.com/aobozhang/aliyun-oss-adapter)
## Installation
```bash
composer require apollopy/flysystem-aliyun-oss
```## for Laravel
This service provider must be registered.
```php
// config/app.php'providers' => [
'...',
ApolloPY\Flysystem\AliyunOss\AliyunOssServiceProvider::class,
];
```edit the config file: config/filesystems.php
add config
```php
'oss' => [
'driver' => 'oss',
'access_id' => env('OSS_ACCESS_ID','your id'),
'access_key' => env('OSS_ACCESS_KEY','your key'),
'bucket' => env('OSS_BUCKET','your bucket'),
'endpoint' => env('OSS_ENDPOINT','your endpoint'),
'prefix' => env('OSS_PREFIX', ''), // optional
],
```change default to oss
```php
'default' => 'oss'
```## Use
see [Laravel wiki](https://laravel.com/docs/5.1/filesystem)
## Plugins
inspire by [itbdw/laravel-storage-qiniu](https://github.com/itbdw/laravel-storage-qiniu)
```php
Storage::disk('oss')->putFile($md5_path, '/local_file_path/1.png', ['mimetype' => 'image/png','filename' => 'filename_by_down.png']);Storage::disk('oss')->signedDownloadUrl($path, 3600, 'oss-cn-beijing.aliyuncs.com', true);
```## IDE Helper
if installed [barryvdh/laravel-ide-helper](https://github.com/barryvdh/laravel-ide-helper)
edit the config file: config/ide-helper.php
```php
'interfaces' => [
'\Illuminate\Contracts\Filesystem\Filesystem' => ApolloPY\Flysystem\AliyunOss\FilesystemAdapter::class,
],
```