PHP Class Toplan\PhpSms\Agent

Show file Open project: toplan/phpsms

Protected Properties

Property Type Description
$config array The configuration information of agent.
$result array The result data.

Public Methods

Method Description
__construct ( array $config = [] ) Constructor.
__get ( $name ) : mixed Overload object properties.
__isset ( $name ) : boolean When using isset() or empty() on inaccessible object properties, the __isset() overloading method will be called.
config ( mixed $key = null, mixed $value = null, boolean $override = false ) : mixed Get or set the configuration information of agent.
curl ( string $url, array $params = [], integer | boolean $isPost = false ) : array cURl
result ( $name = null, $value = null ) : mixed Set/get result data.
sendContentSms ( $to, $content ) Content SMS send process.
sendSms ( $to, $content, $tempId, array $tempData ) SMS send process.
sendTemplateSms ( $to, $tempId, array $tempData ) Template SMS send process.
sockPost ( $url, array $query, $port = 80 ) : mixed Http post request.
voiceVerify ( $to, $code, $tempId, array $tempData ) Voice verify send process.

Method Details

__construct() public method

Constructor.
public __construct ( array $config = [] )
$config array

__get() public method

Overload object properties.
public __get ( $name ) : mixed
$name
return mixed

__isset() public method

When using isset() or empty() on inaccessible object properties, the __isset() overloading method will be called.
public __isset ( $name ) : boolean
$name
return boolean

config() public method

Get or set the configuration information of agent.
public config ( mixed $key = null, mixed $value = null, boolean $override = false ) : mixed
$key mixed
$value mixed
$override boolean
return mixed

curl() public static method

cURl
public static curl ( string $url, array $params = [], integer | boolean $isPost = false ) : array
$url string [请求的URL地址]
$params array [请求的参数]
$isPost integer | boolean [是否采用POST形式]
return array ['request', 'response'] request:是否请求成功 response:响应数据

result() public method

Set/get result data.
public result ( $name = null, $value = null ) : mixed
$name
$value
return mixed

sendContentSms() abstract public method

Content SMS send process.
abstract public sendContentSms ( $to, $content )
$to
$content

sendSms() abstract public method

SMS send process.
abstract public sendSms ( $to, $content, $tempId, array $tempData )
$to
$content
$tempId
$tempData array

sendTemplateSms() abstract public method

Template SMS send process.
abstract public sendTemplateSms ( $to, $tempId, array $tempData )
$to
$tempId
$tempData array

sockPost() public static method

Http post request.
public static sockPost ( $url, array $query, $port = 80 ) : mixed
$url
$query array
$port
return mixed

voiceVerify() abstract public method

Voice verify send process.
abstract public voiceVerify ( $to, $code, $tempId, array $tempData )
$to
$code
$tempId
$tempData array

Property Details

$config protected property

The configuration information of agent.
protected array $config
return array

$result protected property

The result data.
protected array $result
return array