PHPackages                             vartruexuan/yii-filesystem-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. vartruexuan/yii-filesystem-cos

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

vartruexuan/yii-filesystem-cos
==============================

yii2 filesystem 腾讯云cos

1.0.1(3y ago)2322MITPHPPHP &gt;=7.4

Since Mar 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/vartruexuan/yii-filesystem-cos)[ Packagist](https://packagist.org/packages/vartruexuan/yii-filesystem-cos)[ GitHub Sponsors](https://github.com/vartruexuan)[ RSS](/packages/vartruexuan-yii-filesystem-cos/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

yii-filesystem-cos
==================

[](#yii-filesystem-cos)

[![Latest Version](https://camo.githubusercontent.com/77b30fcaca1e6e877fafec6ccf2537afd61fcccdbc4bab491e45405f0f4d48f4/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f766172747275657875616e2f7969692d66696c6573797374656d2d636f73)](https://packagist.org/packages/vartruexuan/yii-filesystem-cos)[![Php Version](https://camo.githubusercontent.com/91760b4f5b11abaf4e90db3e1c44ecbe5926c917828d6554d043b283acd26fbb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e342d627269676874677265656e2e7376673f6d61784167653d32353932303030)](https://www.php.net)

概述
==

[](#概述)

[creocoder/yii2-flysystem](https://github.com/creocoder/yii2-flysystem)

安装
==

[](#安装)

```
composer require vartruexuan/yii-filesystem-cos
```

使用
==

[](#使用)

配置组件
----

[](#配置组件)

```
// 加入配置组件
'components' => [
    'cos' => [
        'class' => 'Vartruexuan\Yii2\Filesystem\Cos\Filesystem',
        // 配置
        'region' => 'gz',
        'appId' => '1272757004',
        'secretId' => 'AKIDd5HCSPDanlU1ILnzwc2sSmpcIqTY',
        'secretKey' => '58kxufPxEiiSWIbeuUqxsYzDB3gAPVLwI',
        'token' => null,
        'timeout' => 60,
        'connect_timeout' => 60,
        'bucket' => 'bucket-1272757004',
        'cdn' => 'https://bucket-1272757004.file.myqcloud.com',
        'scheme' => 'https',
        'read_from_cdn' => false,
        'cdn_key' => '',
        'encrypt' => false,
    ],
],
```

使用
--

[](#使用-1)

```
bool Yii::$app->cos->->write('file.md', 'contents');
bool Yii::$app->cos->->writeStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));
bool Yii::$app->cos->->update('file.md', 'new contents');
bool Yii::$app->cos->->updateStram('file.md', fopen('path/to/your/local/file.jpg', 'r'));
bool Yii::$app->cos->->rename('foo.md', 'bar.md');
bool Yii::$app->cos->->copy('foo.md', 'foo2.md');
bool Yii::$app->cos->->delete('file.md');
bool Yii::$app->cos->->has('file.md');
string|false Yii::$app->cos->->read('file.md');
array Yii::$app->cos->->listContents();
array Yii::$app->cos->->getMetadata('file.md');
int Yii::$app->cos->->getSize('file.md');
string Yii::$app->cos->->getUrl('file.md');
string Yii::$app->cos->->getTemporaryUrl('file.md', date_create('2018-12-31 18:12:31'));
string Yii::$app->cos->->getMimetype('file.md');
int Yii::$app->cos->->getTimestamp('file.md');
string Yii::$app->cos->->getVisibility('file.md');
bool Yii::$app->cos->->setVisibility('file.md', 'public'); //or 'private', 'default'
// ...
```

[详细文档](https://flysystem.thephpleague.com/api/)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

3

Last Release

1160d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9845d441ce163b641f66e392752a334a733c14697303da398bb02437c3a9d1b2?d=identicon)[vartruexuan](/maintainers/vartruexuan)

---

Top Contributors

[![vartruexuan](https://avatars.githubusercontent.com/u/20641529?v=4)](https://github.com/vartruexuan "vartruexuan (3 commits)")

---

Tags

filesystemfilesyii2cos

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vartruexuan-yii-filesystem-cos/health.svg)

```
[![Health](https://phpackages.com/badges/vartruexuan-yii-filesystem-cos/health.svg)](https://phpackages.com/packages/vartruexuan-yii-filesystem-cos)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

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

WebDAV filesystem adapter for Flysystem.

762.3M56](/packages/league-flysystem-webdav)

PHPackages © 2026

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