PHPackages                             hepeichun/flysystem-cos - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. hepeichun/flysystem-cos

ActiveLibrary[File &amp; Storage](/categories/file-storage)

hepeichun/flysystem-cos
=======================

Flysystem adapter for the QCloud COS storage.

01PHP

Since Jul 22Pushed 1y agoCompare

[ Source](https://github.com/hepeichun/flysystem-cos)[ Packagist](https://packagist.org/packages/hepeichun/flysystem-cos)[ RSS](/packages/hepeichun-flysystem-cos/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Flysystem QCloud COS
====================

[](#flysystem-qcloud-cos)

---

💾 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://camo.githubusercontent.com/cf355f9bf8742e172f19c87031a5ebcf1eb2bd3c2a4942094be7d43cdd96b340/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f762f737461626c652e737667)](https://packagist.org/packages/overtrue/flysystem-cos) [![Latest Unstable Version](https://camo.githubusercontent.com/c116dac52a3dad7480fe83a6fceacd06d72e132af4414052565237ce44efe2e3/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f762f756e737461626c652e737667)](https://packagist.org/packages/overtrue/flysystem-cos) [![Total Downloads](https://camo.githubusercontent.com/fc499ab63392a59ebab358f714b2b91d912ed72a711db7955c189628ebb3c7af/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f646f776e6c6f616473)](https://packagist.org/packages/overtrue/flysystem-cos) [![License](https://camo.githubusercontent.com/27df82cff44d4353aebab097cf0be0d3da31b136c932be4039b1ddfdf1611bd2/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f6c6963656e7365)](https://packagist.org/packages/overtrue/flysystem-cos)

[![Sponsor me](https://github.com/overtrue/overtrue/raw/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)

Requirement
-----------

[](#requirement)

- PHP &gt;= 8.0.2

Installation
------------

[](#installation)

```
composer require overtrue/flysystem-cos -vvv
```

Usage
-----

[](#usage)

```
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
---

[](#api)

```
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');
```

❤️ Sponsor me
-------------

[](#heart-sponsor-me)

[![Sponsor me](https://github.com/overtrue/overtrue/raw/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)

如果你喜欢我的项目并想支持它，[点击这里 ❤️](https://github.com/sponsors/overtrue)

Project supported by JetBrains
------------------------------

[](#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://camo.githubusercontent.com/3cf726e7cdadba47755b7f7ea4227945a92a2fa48aadf4a2573140ec6501c989/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a625f6265616d2e737667)](https://www.jetbrains.com/?from=https://github.com/overtrue)

License
-------

[](#license)

MIT

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/189c74f25f2e7961eb8d18706081a0dd58f502d505ba0a8b411f0f10e0760f93?d=identicon)[hepeichun](/maintainers/hepeichun)

---

Top Contributors

[![overtrue](https://avatars.githubusercontent.com/u/1472352?v=4)](https://github.com/overtrue "overtrue (69 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (4 commits)")[![limingxinleo](https://avatars.githubusercontent.com/u/16648551?v=4)](https://github.com/limingxinleo "limingxinleo (2 commits)")[![ramzeng](https://avatars.githubusercontent.com/u/38133602?v=4)](https://github.com/ramzeng "ramzeng (2 commits)")[![lddtime](https://avatars.githubusercontent.com/u/19882218?v=4)](https://github.com/lddtime "lddtime (2 commits)")[![russellxrs](https://avatars.githubusercontent.com/u/39029427?v=4)](https://github.com/russellxrs "russellxrs (1 commits)")[![summerblue](https://avatars.githubusercontent.com/u/324764?v=4)](https://github.com/summerblue "summerblue (1 commits)")[![hepeichun](https://avatars.githubusercontent.com/u/13855247?v=4)](https://github.com/hepeichun "hepeichun (1 commits)")

### Embed Badge

![Health badge](/badges/hepeichun-flysystem-cos/health.svg)

```
[![Health](https://phpackages.com/badges/hepeichun-flysystem-cos/health.svg)](https://phpackages.com/packages/hepeichun-flysystem-cos)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
