2017 © Pedro Peláez
 

project alisms

Aliyun sms developer kits

image

swallsky/alisms

Aliyun sms developer kits

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 36 % Grown

The README.md

AliSMS

阿里云短信服务开发工具包, (*1)

开始使用

composer

  • composer require swallsky/alisms

使用方法1

//require('../vendor/autoload.php'); //加载composer,一般情况下这个都是框架集成

$res = SwaSky\Alisms\Send::verifyCode('手机号',mt_rand(1000,9999),[
    'accessKeyId'   =>  '', //阿里云 acess key
    'accessKeySecret'  => '', //阿里云 access secret
    'signName'  =>  '', //短信签名
    'templateCode'  =>  '', //短信模板code
    'logfile'   =>  '' //短信异常信息日志文件信息
]);
if($res==0){
    echo '发送失败!';
}else{
    echo '发送成功!';
}

使用方法2

默认配置文件在app/config/alisms.php,可以通过设置verifyCode第三个参数改变配置信息路径 ```alisms.php /** * 短信配置信息 */ return [ 'isopen' => true,//默认为true,开启发送功能,如果为false时,发送会显示成功,但是并不发送短信,此参数在开发调试时较重要 'accessKeyId' => env('ALI_ACCESSKEY'), //阿里云Access ID 'accessKeySecret' => env('ALI_ACCESSKEYSECRET'), //阿里云Access Key 'signName' => env('ALI_SIGNNAME'), //短信签名 'templateCode' => env('ALI_TEMPCODE'), //短信模板code 'logfile' => storage_path('logs/alisms-'.date('Y-m-d').'.log') //日志保存目录 ];, (*2)


```send.php //require('../vendor/autoload.php'); //加载composer,一般情况下这个都是框架集成 $res = SwaSky\Alisms\Send::verifyCode('手机号',mt_rand(1000,9999)); if($res==0){ echo '发送失败!'; }else{ echo '发送成功!'; }

发送其他类型的短信

默认配置文件在app/config/alisms.php,可以通过设置verifyCode第三个参数改变配置信息路径 ```alisms.php /** * 短信配置信息 */ return [ 'isopen' => true,//默认为true,开启发送功能,如果为false时,发送会显示成功,但是并不发送短信,此参数在开发调试时较重要 'accessKeyId' => env('ALI_ACCESSKEY'), //阿里云Access ID 'accessKeySecret' => env('ALI_ACCESSKEYSECRET'), //阿里云Access Key 'signName' => env('ALI_SIGNNAME'), //短信签名 'templateCode' => env('ALI_TEMPCODE'), //短信模板code 'logfile' => storage_path('logs/alisms-'.date('Y-m-d').'.log') //日志保存目录 ];, (*3)


```send.php //require('../vendor/autoload.php'); //加载composer,一般情况下这个都是框架集成 use SwaSky\Alisms\Sms; $res = Sms::send( '手机号码', //接收者手机号 [//发送的数据 'cname' => '公司名称', 'password' => mt_rand(100,999) ], 'SMS_112780100' //短信模板 => 模版CODE ); if($res==0){ echo '发送失败!'; }else{ echo '发送成功!'; }

获取Access ID和Access Key

如何获取Access ID和Access Key, (*4)

短信相关操作

短信签名 短信模板, (*5)

The Versions

23/11 2017

dev-master

9999999-dev https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

23/11 2017

v0.3.0

0.3.0.0 https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

v0.2.3

0.2.3.0 https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

0.1.2.x-dev

0.1.2.9999999-dev https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

v0.2.2

0.2.2.0 https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

0.1.1.x-dev

0.1.1.9999999-dev https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

0.1.x-dev

0.1.9999999.9999999-dev https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

v0.2.1

0.2.1.0 https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

v0.2

0.2.0.0 https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky

26/07 2017

v0.1

0.1.0.0 https://github.com/swallsky/alisms.git

Aliyun sms developer kits

  Sources   Download

MIT

The Requires

 

alisms swallsky