tugmaks/sms-sender
Composer 安装命令:
composer require tugmaks/sms-sender
包简介
SMS sender library
关键字:
README 文档
README
SMS sender library
Installation
The preferred way to install this extension is through composer.
Add
"tugmaks/sms-sender": "dev-master"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
use tugmaks/SMS/gates/ItakazanGate; $gate = new ItakazanGate([ 'login'=>'yourlogin', 'password'=>'yourpassword', 'mac'=>'yourmac', ]); echo $gate->getBalance();
By default Itakazan gate use one url to access its api. You can get it via $gate->getGateUrl(). If this gate will use another url or mirrors you can redefine it like this:
use tugmaks/SMS/gates/ItakazanGate; $gate = new ItakazanGate([ 'login'=>'yourlogin', 'password'=>'yourpassword', 'mac'=>'yourmac', ]); $gate->setGateUrl = 'http://new-api-address.me';
Error handling. Each request to api will return its result or false if error occured. To get error respresentation you can use this code:
if(!$gate->someMethod()){ //handle error here echo $gate->getError(); }
Methods.
$gate->getBalance()will return current balance (float) or false if error occured.php $gate->getSignatures()return array of allowed signatures or false if error occured. Example :php [0=>'signat1',1=>'loremsignat'].php $gate->getPrices()- addSignature()
- deleteSignature()
- getArchive()
- send()
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-17