PHPackages                             lyzhang1999/aliyun-dysms-php-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. lyzhang1999/aliyun-dysms-php-sdk

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

lyzhang1999/aliyun-dysms-php-sdk
================================

Aliyun SMS SDK for PHP

v2.0(7y ago)1897Apache-2.0PHPPHP &gt;=5.5.0

Since Dec 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lyzhang1999/aliyun-dysms-php-sdk)[ Packagist](https://packagist.org/packages/lyzhang1999/aliyun-dysms-php-sdk)[ Docs](https://www.aliyun.com/product/sms)[ RSS](/packages/lyzhang1999-aliyun-dysms-php-sdk/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

aliyun-dysms-php-sdk
====================

[](#aliyun-dysms-php-sdk)

阿里云-云通信PHP版sdk精简，非原先阿里大于SDK，原阿里大鱼被合并进了“阿里云-云通信”。

“阿里云-云通信”的SDK已变化，原先阿里大鱼的SDK已无法使用，此git库为新版“阿里云-云通信”提供的SDK打成composer包

为了便于composer管理，特制作该git库，版权归阿里所有，本人仅处理、精简、适配自己业务的部分代码；详情请查看各commit

> v2.0版做了精简，去除了单元测试和相关文件，v1.0版保留原SDK核心

composer安装
----------

[](#composer安装)

`composer require jjonline/aliyun-dysms-php-sdk`

*若需要原SDK核心，请使用v1.0版*

composer安装后用法就跟官方文档没什么区别了，做个示例：

```
use Aliyun\Core\Config as AliyunConfig;
use Aliyun\Core\Profile\DefaultProfile;
use Aliyun\Core\DefaultAcsClient;
use Aliyun\Api\Sms\Request\V20170525\SendSmsRequest;
use Aliyun\Api\Sms\Request\V20170525\QuerySendDetailsRequest;

// 阿里云Access Key ID和Access Key Secret 从 https://ak-console.aliyun.com 获取
$appKey = '你的Access Key ID';
$appSecret = '你的Access Key Secret';

// 短信签名 详见：https://dysms.console.aliyun.com/dysms.htm?spm=5176.2020520001.1001.3.psXEEJ#/sign
$signName  = '你的短信签名';

// 短信模板Code https://dysms.console.aliyun.com/dysms.htm?spm=5176.2020520001.1001.3.psXEEJ#/template
$template_code = '你的短信模版CODE';

// 短信中的替换变量json字符串
$json_string_param = '你的短信变量替换字符串';

// 接收短信的手机号码
$phone = '接收短信的手机号码';

// 初始化阿里云config
AliyunConfig::load();
// 初始化用户Profile实例
$profile = DefaultProfile::getProfile("cn-hangzhou", $appKey, $appSecret);
DefaultProfile::addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
$acsClient = new DefaultAcsClient($profile);
// 初始化SendSmsRequest实例用于设置发送短信的参数
$request = new SendSmsRequest();
// 必填，设置短信接收号码
$request->setPhoneNumbers($phone);
// 必填，设置签名名称
$request->setSignName($signName);
// 必填，设置模板CODE
$request->setTemplateCode($template_code);

// 可选，设置模板参数
if(!empty($json_string_param)) {
    $request->setTemplateParam($json_string_param);
}

// 可选，设置流水号
// if($outId) {
//     $request->setOutId($outId);
// }

// 发起请求
$acsResponse =  $acsClient->getAcsResponse($request);
// 默认返回stdClass，通过返回值的Code属性来判断发送成功与否
if($acsResponse && strtolower($acsResponse->Code) == 'ok')
{
    return true;
}
return false;

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

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

Total

3

Last Release

2697d ago

Major Versions

v1.0.1 → v2.02018-12-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/167510438a2cb0fd0f07cae8fe95a19fea38e441b14f158bdbcc026b9a854b29?d=identicon)[lyzhang1999](/maintainers/lyzhang1999)

---

Top Contributors

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

---

Tags

sdksmsaliyun

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lyzhang1999-aliyun-dysms-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/lyzhang1999-aliyun-dysms-php-sdk/health.svg)](https://phpackages.com/packages/lyzhang1999-aliyun-dysms-php-sdk)
```

###  Alternatives

[jjonline/aliyun-dysms-php-sdk

Aliyun SMS SDK for PHP

2197.2k](/packages/jjonline-aliyun-dysms-php-sdk)[curder/laravel-aliyun-sms

阿里云短信服务 - Laravel

113.6k](/packages/curder-laravel-aliyun-sms)[fastgoo/aliyun-sms

阿里云短信扩展包

1815.3k](/packages/fastgoo-aliyun-sms)

PHPackages © 2026

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