PHPackages                             chocoboxxf/yii2-yunpian-sdk - 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. [API Development](/categories/api)
4. /
5. chocoboxxf/yii2-yunpian-sdk

ActiveYii2-extension[API Development](/categories/api)

chocoboxxf/yii2-yunpian-sdk
===========================

YunPian API for Yii 2.0

1391PHP

Since Jan 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/chocoboxxf/yii2-yunpian-sdk)[ Packagist](https://packagist.org/packages/chocoboxxf/yii2-yunpian-sdk)[ RSS](/packages/chocoboxxf-yii2-yunpian-sdk/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-yunpian-sdk
================

[](#yii2-yunpian-sdk)

基于Yii2实现的云片(YunPian)短信API SDK（目前开发中）

环境条件
----

[](#环境条件)

- > = PHP 5.4
- > = Yii 2.0
- > = GuzzleHttp 5.0

安装
--

[](#安装)

添加下列代码在`composer.json`文件中并执行`composer update --no-dev`操作

```
{
    "require": {
       "chocoboxxf/yii2-yunpian-sdk": "dev-master"
    }
}
```

设置方法
----

[](#设置方法)

```
// 全局使用
// 在config/main.php配置文件中定义component配置信息
'components' => [
  .....
  'sms' => [
      'class' => 'chocoboxxf\YunPian\YunPianSms',
      'apiKey' => '云片网络的APIKEY',
  ]
  ....
]
// 代码中调用
$result = Yii::$app->sms->send('手机号', '短信内容');
....
```

```
// 局部调用
$sms = Yii::createObject([
    'class' => 'chocoboxxf\YunPian\YunPianSms',
    'apiKey' => '云片网络的APIKEY',
]);
$result = $sms->send('手机号', '短信内容');
....
```

使用示例
----

[](#使用示例)

发送短信

```
try {
    $result = Yii::$app->Sms->send('手机号', '短信内容');
} catch (\chocoboxxf\YunPian\YunPianException $ex) {
    $code  = $ex->getCode(); // 错误码
    $message = $ex->getMessage(); // 错误信息
    $detail = $ex->getDetail(); // 错误详细信息
}
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

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/3401509?v=4)[许晓峰](/maintainers/chocoboxxf)[@chocoboxxf](https://github.com/chocoboxxf)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/chocoboxxf-yii2-yunpian-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/chocoboxxf-yii2-yunpian-sdk/health.svg)](https://phpackages.com/packages/chocoboxxf-yii2-yunpian-sdk)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k16](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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