PHPackages                             mclxly/tencentyun-cos-php - 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. mclxly/tencentyun-cos-php

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

mclxly/tencentyun-cos-php
=========================

A package based on cos-php-sdk-v4

124PHP

Since Jun 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mclxly/tencentyun-cos-php)[ Packagist](https://packagist.org/packages/mclxly/tencentyun-cos-php)[ RSS](/packages/mclxly-tencentyun-cos-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

tencentyun-cos-php
==================

[](#tencentyun-cos-php)

基于cos-php-sdk-v4，稍作包装，便于使用

### 封装自[cos-php-sdk-v4](https://github.com/tencentyun/cos-php-sdk-v4)

[](#封装自cos-php-sdk-v4)

### 增加接口

[](#增加接口)

- 上传整个目录

### 用法

[](#用法)

安装：composer require "mclxly/tencentyun-cos-php:dev-master"

```
use QCloud\Cos\Api as CosApi;
...
    $appID = env('QCLOUD_APPID','');
    $secretID = env('QCLOUD_SECRET_ID','');
    $secretKey = env('QCLOUD_SECRET_KEY','');
    $bucket = 'asset';

    $config = array(
      'app_id' => $appID,
      'secret_id' => $secretID,
      'secret_key' => $secretKey,
      'region' => 'gz',
      'timeout' => 60
    );
    $cosApi = new CosApi($config);

    // 上传文件夹
    $srcDir = public_path().'/css';
    // bucket回源地址的实际路径，用于生成目标相对路径
    $bucketBaseDir = public_path();
    $ret = $cosApi->uploadFolder($bucket, $srcDir, $bucketBaseDir);
    var_dump($ret);
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1973671?v=4)[Colin](/maintainers/mclxly)[@mclxly](https://github.com/mclxly)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/mclxly-tencentyun-cos-php/health.svg)

```
[![Health](https://phpackages.com/badges/mclxly-tencentyun-cos-php/health.svg)](https://phpackages.com/packages/mclxly-tencentyun-cos-php)
```

PHPackages © 2026

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