You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
919 B

3 years ago
<?php
/**
* 短信发送驱动
*/
namespace libraries\send;
class SmsDriver implements SendInterface{
protected $config = array(
'sms_name' => '',
'sms_password' => '',
);
protected $errorMsg = '';
protected $sms;
public function __construct( $config = array() ) {
$this->config = array_merge($this->config, $config);
$this->sms = new \libraries\Sms($this->config);
}
/**
* 发送短信
* @param string $to 收信人
* @param string $title 标题
* @param string $content 内容
* @param array $data 其他数据
* @return array
*/
public function push($to, $title, $content, $time = '', $data = array()) {
return $this->sms->setSms($content)->sendSms($to);
}
public function getError(){
return $this->sms->getError();
}
3 years ago
}