PHPackages                             xy\_jx/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. xy\_jx/flysystem-cos

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

xy\_jx/flysystem-cos
====================

Flysystem adapter for the QCloud COS storage.

1.1.0(4y ago)22381MITPHPPHP &gt;=7.0

Since Aug 6Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (8)Used By (1)

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

[](#flysystem-qcloud-cos)

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

[](#requirement)

- PHP &gt;= 7.0

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

[](#installation)

```
$ composer require xy_jx/flysystem-cos -vvv
```

Usage
-----

[](#usage)

```
use League\Flysystem\Filesystem;
use xy_jx\Flysystem\CosAdapter;

$config = [
    'region'      => 'ap-guangzhou',
    'credentials' => [
        'appId'      => 1234567889, // 域名中数字部分
        'secretId'   => 'AKIDS5jNr5NNygGxxxxxxxxxxxxxxxxxx',
        'secretKey'  => 'NfszEWmyDqGmao0a4XS8wxxxxxxxxxxxx',
    ],
    'bucket'          => 'test',
    'timeout'         => 60,
    'connect_timeout' => 60,
    'cdn'             => '您的 CDN 域名',
    'scheme'          => 'https',
    'read_from_cdn'   => false,
];

$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->update('file.md', 'new contents');

bool $flysystem->updateStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));

bool $flysystem->rename('foo.md', 'bar.md');

bool $flysystem->copy('foo.md', 'foo2.md');

bool $flysystem->delete('file.md');

bool $flysystem->has('file.md');

string|false $flysystem->read('file.md');

array $flysystem->listContents();

array $flysystem->getMetadata('file.md');

int $flysystem->getSize('file.md');

string $flysystem->getAdapter()->getUrl('file.md');

string $flysystem->getMimetype('file.md');

int $flysystem->getTimestamp('file.md');
```

Plugins
-------

[](#plugins)

TODO

PHP 扩展包开发
---------

[](#php-扩展包开发)

> 想知道如何从零开始构建 PHP 扩展包？
>
> 请关注我的实战课程，我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

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

Every ~0 days

Total

7

Last Release

1735d ago

Major Versions

0.1.3 → 1.0.02021-08-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/73cafb51412d52685ea85aac0862793fb6ab965e19c0c59e3a098807803289f4?d=identicon)[xy](/maintainers/xy)

---

Top Contributors

[![XY-JX](https://avatars.githubusercontent.com/u/57987232?v=4)](https://github.com/XY-JX "XY-JX (8 commits)")

### Embed Badge

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

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

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[google/cloud

Google Cloud Client Library

1.2k16.2M54](/packages/google-cloud)[stechstudio/laravel-zipstream

A fast and simple streaming zip file downloader for Laravel.

4633.7M3](/packages/stechstudio-laravel-zipstream)[masbug/flysystem-google-drive-ext

Flysystem adapter for Google Drive with seamless virtual&lt;=&gt;display path translation

2631.7M14](/packages/masbug-flysystem-google-drive-ext)[dgtlss/capsule

A Laravel package for backing up databases and files to external sources with notifications

194.3k](/packages/dgtlss-capsule)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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