PHPackages                             apixx/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. apixx/flysystem-cos

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

apixx/flysystem-cos
===================

Flysystem adapter for the QCloud COS storage.

1.0(3y ago)1811MITPHPPHP &gt;=8.0.2

Since Nov 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LeePillar/flysystem-cos)[ Packagist](https://packagist.org/packages/apixx/flysystem-cos)[ GitHub Sponsors](https://github.com/overtrue)[ RSS](/packages/apixx-flysystem-cos/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (1)

Flysystem QCloud COS

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

[](#requirement)

- PHP &gt;= 8.0.2

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

[](#installation)

```
$ composer require apixx/flysystem-cos
```

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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1277d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4f5905f4d535af692d2e80dfbdf9ff3731861b68afb547c8b811b21a2e57875?d=identicon)[LeePillar](/maintainers/LeePillar)

---

Top Contributors

[![LeePillar](https://avatars.githubusercontent.com/u/101307498?v=4)](https://github.com/LeePillar "LeePillar (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[league/flysystem-local

Local filesystem adapter for Flysystem.

226231.8M39](/packages/league-flysystem-local)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40029.5M87](/packages/league-flysystem-bundle)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8533.6M194](/packages/league-flysystem-memory)

PHPackages © 2026

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