Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/overtrue/flysystem-cos
:floppy_disk: Flysystem adapter for the Qcloud COS storage.
https://github.com/overtrue/flysystem-cos
flysystem flysystem-adapter qcloud qcloud-cos
Last synced: 7 days ago
JSON representation
:floppy_disk: Flysystem adapter for the Qcloud COS storage.
- Host: GitHub
- URL: https://github.com/overtrue/flysystem-cos
- Owner: overtrue
- Created: 2018-11-15T04:27:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T07:26:08.000Z (8 months ago)
- Last Synced: 2024-05-17T05:43:48.289Z (7 months ago)
- Topics: flysystem, flysystem-adapter, qcloud, qcloud-cos
- Language: PHP
- Size: 73.2 KB
- Stars: 72
- Watchers: 3
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Flysystem QCloud COS
---
:floppy_disk: Flysystem adapter for the Qcloud COS storage.
[![Test](https://github.com/overtrue/flysystem-cos/actions/workflows/test.yml/badge.svg)](https://github.com/overtrue/flysystem-cos/actions/workflows/test.yml) [![Latest Stable Version](https://poser.pugx.org/overtrue/flysystem-cos/v/stable.svg)](https://packagist.org/packages/overtrue/flysystem-cos) [![Latest Unstable Version](https://poser.pugx.org/overtrue/flysystem-cos/v/unstable.svg)](https://packagist.org/packages/overtrue/flysystem-cos) [![Total Downloads](https://poser.pugx.org/overtrue/flysystem-cos/downloads)](https://packagist.org/packages/overtrue/flysystem-cos) [![License](https://poser.pugx.org/overtrue/flysystem-cos/license)](https://packagist.org/packages/overtrue/flysystem-cos)
[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)
## Requirement
* PHP >= 8.0.2
## Installation
```shell
composer require overtrue/flysystem-cos -vvv
```## Usage
```php
use League\Flysystem\Filesystem;
use Overtrue\Flysystem\Cos\CosAdapter;$config = [
// 必填,app_id、secret_id、secret_key
// 可在个人秘钥管理页查看:https://console.cloud.tencent.com/capi
'app_id' => 10020201024,
'secret_id' => 'AKIDsiQzQla780mQxLLU2GJCxxxxxxxxxxx',
'secret_key' => 'b0GMH2c2NXWKxPhy77xhHgwxxxxxxxxxxx','region' => 'ap-guangzhou',
'bucket' => 'example',
// 可选,如果 bucket 为私有访问请打开此项
'signed_url' => false,
// 可选,是否使用 https,默认 false
'use_https' => true,
// 可选,自定义域名
'domain' => 'emample-12340000.cos.test.com',
// 可选,使用 CDN 域名时指定生成的 URL host
'cdn' => 'https://youcdn.domain.com/',
];$adapter = new CosAdapter($config);
$flysystem = new League\Flysystem\Filesystem($adapter);
```
## API```php
bool $flysystem->write('file.md', 'contents');
bool $flysystem->write('file.md', 'http://httpbin.org/robots.txt', ['mime' => 'application/redirect302']);
bool $flysystem->writeStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));
bool $flysystem->move('foo.md', 'bar.md');
bool $flysystem->copy('foo.md', 'foo2.md');
bool $flysystem->delete('file.md');
bool $flysystem->fileExists('file.md');
string|mixed|false $flysystem->read('file.md');
array $flysystem->listContents();
int $flysystem->fileSize('file.md');
string $flysystem->mimeType('file.md');
int $flysystem->lastModified('file.md');
```
## :heart: Sponsor me
[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)
如果你喜欢我的项目并想支持它,[点击这里 :heart:](https://github.com/sponsors/overtrue)
## Project supported by JetBrains
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
[![](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/overtrue)
## License
MIT