Package Data | |
---|---|
Maintainer Username: | flc1125 |
Package Create Date: | 2016-07-12 |
Package Last Update: | 2019-10-18 |
Home Page: | http://flc.io/2016/09/563.html |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-09 15:00:24 |
Package Statistics | |
---|---|
Total Downloads: | 47,962 |
Monthly Downloads: | 386 |
Daily Downloads: | 7 |
Total Stars: | 181 |
Total Watchers: | 9 |
Total Forks: | 63 |
Total Open Issues: | 3 |
PS:阿里短信 https://github.com/flc1125/dysms
待测
:因个人开发者,阿里大于权限相对较低。暂时无法测试;功能已开发,如测试可用,请告知~~
composer require flc/alidayu
或
require '/path/to/alidayu/autoload.php';
<?php
use Flc\Alidayu\Client;
use Flc\Alidayu\App;
use Flc\Alidayu\Requests\AlibabaAliqinFcSmsNumSend;
use Flc\Alidayu\Requests\IRequest;
// 配置信息
$config = [
'app_key' => '*****',
'app_secret' => '************',
// 'sandbox' => true, // 是否为沙箱环境,默认false
];
// 使用方法一
$client = new Client(new App($config));
$req = new AlibabaAliqinFcSmsNumSend;
$req->setRecNum('13312311231')
->setSmsParam([
'number' => rand(100000, 999999)
])
->setSmsFreeSignName('叶子坑')
->setSmsTemplateCode('SMS_15105357');
$resp = $client->execute($req);
// 使用方法二
Client::configure($config); // 全局定义配置(定义一次即可,无需重复定义)
$resp = Client::request('alibaba.aliqin.fc.sms.num.send', function (IRequest $req) {
$req->setRecNum('13312311231')
->setSmsParam([
'number' => rand(100000, 999999)
])
->setSmsFreeSignName('叶子坑')
->setSmsTemplateCode('SMS_15105357');
});
// 返回结果
print_r($resp);
print_r($resp->result->model);
?>