PHPackages                             fengerzh/yii2-bos - 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. fengerzh/yii2-bos

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

fengerzh/yii2-bos
=================

Baidu cloud storage for Yii2

0.3.0(8y ago)112MITPHP

Since Jun 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fengerzh/yii2-bos)[ Packagist](https://packagist.org/packages/fengerzh/yii2-bos)[ Docs](https://github.com/fengerzh/yii2-bos)[ RSS](/packages/fengerzh-yii2-bos/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (9)Used By (0)

安装
==

[](#安装)

在`composer.json`中添加

```
"fengerzh/yii2-bos": "*"

```

然后，执行

```
composer update

```

用法
==

[](#用法)

设置
--

[](#设置)

将以下键值存入配置文件`common\config\main.php`或`common\config\params.php`：

```
'baidu.bos.ak' => '*** key ***',
'baidu.bos.sk' => '*** secret ***',

```

存入百度云
-----

[](#存入百度云)

```
use fengerzh\bos\Bos;

$pic_name = Bos::saveToBos($model, $field_name, $bucket, $path, $filename);

```

参数说明：

- $model, 数据库记录
- $field\_name, 字符串，存储图片文件的字段
- $bucket, 字符串，BOS的库名
- $path, 字符串，远端路径名，不包括文件名
- $filename, 字符串，文件名

从百度云删除
------

[](#从百度云删除)

```
use fengerzh\bos\Bos;

Bos::deleteFromBos($bucket, $objectKey);

```

参数说明：

- $bucket, 字符串，BOS的库名
- $objectKey, 字符串，文件路径，包括文件名

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~6 days

Total

7

Last Release

3267d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2883744?v=4)[Buzz Zhang](/maintainers/fengerzh)[@fengerzh](https://github.com/fengerzh)

---

Top Contributors

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

---

Tags

yii2bos

### Embed Badge

![Health badge](/badges/fengerzh-yii2-bos/health.svg)

```
[![Health](https://phpackages.com/badges/fengerzh-yii2-bos/health.svg)](https://phpackages.com/packages/fengerzh-yii2-bos)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[liyunfang/yii2-upload-behavior

Upload behavior for Yii 2

161.7k](/packages/liyunfang-yii2-upload-behavior)

PHPackages © 2026

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