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(5y ago)22631MITPHPPHP &gt;=7.0

Since Aug 6Pushed 5y 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

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

1834d ago

Major Versions

0.1.3 → 1.0.02021-08-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15524212?v=4)[xy](/maintainers/xy)[@xy](https://github.com/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

[laravel/framework

The Laravel Framework.

34.9k556.2M21.5k](/packages/laravel-framework)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.9M535](/packages/pimcore-pimcore)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)

PHPackages © 2026

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