nek-v/yii-esmsc
最新稳定版本:1.0.3
Composer 安装命令:
composer require nek-v/yii-esmsc
包简介
Extension for sending SMS messages
README 文档
README
This extension is designed to send sms messages through different services and protocols.
You can add your providers extending class ESMSCProvider.
See the examples in the directory providers
Resources
- Concept and some code: Yii EAuth
- Yii Framework
- php-smpp
- SMPP v3.4
- Kannel
Requirements
- PHP 5.3+
- Yii 1.1 or above
Installation
- Configure your composer.json as in the example below
... "require": { "nek-v/yii-esmsc" } ...
- Or extract the files with the extension in the protected/extensions
- In your
protected/config/main.php, add the following:
<?php ... 'aliases' => array( // Path to vendor dir 'vendor' => realpath(__DIR__ . '/../vendor'), ), 'import' => array( 'vendor.nek-v.yii-esmsc.*', ), 'components' => array( 'sms' => array( 'class' => 'vendor.nek-v.yii-esmsc.ESMSC', 'provides' => array( 'dummy' => array( 'class' => 'DummyProvider' ), 'smpp' => array( 'class' => 'SMPPProvider', 'server' => 'smpp server', 'port' => 'smpp port', 'login' => 'smpp login', 'password' => 'smpp passwod', 'source' => 'sender name' ) ) ) ) ...
Usage
<?php class SiteController extends CController { public function actionIndex() { $text = 'Hello world!'; $phone = '1234567891011'; $provider = Yii::app()->sms; // Dummy $provider->getInstance('dummy')->send($phone, $text); // SMPP $provider->getInstance('smpp')->send($phone, $text); } }
统计信息
- 总下载量: 59
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-17