PHPackages                             mlw/sms - 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. mlw/sms

ActiveLibrary

mlw/sms
=======

MLW SMS library for integration with MlwSms SMS service.

v1.0.0(1y ago)03MITPHPPHP &gt;=7.4

Since Sep 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/gslj9512/mlw_sms)[ Packagist](https://packagist.org/packages/mlw/sms)[ RSS](/packages/mlw-sms/feed)WikiDiscussions main Synced 1mo ago

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

MlwSms PHP SDK
==============

[](#mlwsms-php-sdk)

MlwSms PHP SDK 是一个 PHP 包，旨在简化与 MlwSms 短信服务的集成。此库封装了与 106 API 的交互，包括发送短信、查询状态等功能。

功能
--

[](#功能)

- **发送短信**: 支持发送验证码短信、群发短信和国际短信。
- **查询状态**: 获取短信发送状态和回复列表。

安装
--

[](#安装)

使用 Composer 安装此包：

```
composer require mlw/sms

```

配置
--

[](#配置)

在使用前，你需要配置 `Config` 类来设置 API 密钥和基本 API URL。请参考以下示例：

使用 `Config` 类创建配置实例，设置你的 API 密钥和基本 API URL。然后创建 `Request` 实例，并用它们创建 `MlwSmsClient` 实例。最后，你可以通过 `Application` 类获取服务实例。

```
use MlwSms\Config\Config;
use MlwSms\Helpers\Request;
use MlwSms\MlwSmsClient;
use MlwSms\Service\Application;

// 创建配置实例
$config = new Config('your_access_key', 'your_secret_key');
// 创建客户端实例
$client = new MlwSmsClient($config);
// 获取应用服务
$app = new Application($client);
```

使用示例
----

[](#使用示例)

### 发送验证码短信

[](#发送验证码短信)

使用 `VerifyCodeService` 服务的 `send` 方法发送验证码短信

请求参数
----

[](#请求参数)

参数名类型必填示例说明mobileString是13900000000接收短信的手机号码（只支持单个手机号）。contentString是先生##9:40##快递公司##1234567发送的短信内容是模板变量内容，多个变量中间用 `##` 或 `$$` 隔开，采用 UTF-8 编码。单个变量限制为 1-20 个字。signString是【测试签名】平台上申请的接口短信签名或者签名 ID（须审核通过），采用 UTF-8 编码。templateIdString是123456平台上申请的接口短信模板 ID（须审核通过）。```
$verifyCodeService = $app->getVerifyCodeService();
$response = $verifyCodeService->send('18912345678', '1234##5', '【测试短信】', '178855');
print_r($response);
```

目录结构
----

[](#目录结构)

```
mlw-sms/
├── src/
│   ├── MlwSmsClient.php              # 核心请求和密钥管理类
│   ├── Config/
│   │   └── Config.php                    # 配置类，用于管理密钥、API URL等
│   ├── Service/
│   │   ├── Application.php               # 统一管理服务入口
│   │   ├── Send/
│   │   │   ├── VerifyCode.php            # 发送验证码业务
│   │   │   ├── Sms.php                   # 发送群发短信业务
│   │   ├── Status/
│   │   │   ├── SendStatus.php            # 查询短信发送状态业务
│   └── Helpers/
│       └── Request.php                   # HTTP 请求处理类
├── tests/                                # 单元测试文件
│   └── MlwSmsClientTest.php
├── composer.json                         # Composer 配置文件
└── README.md                             # 文档
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

620d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mlw-sms/health.svg)

```
[![Health](https://phpackages.com/badges/mlw-sms/health.svg)](https://phpackages.com/packages/mlw-sms)
```

PHPackages © 2026

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