\thirdThirdBase

第三方接口基类 Class ThirdBase

Summary

Methods
Properties
Constants
__construct()
$errCode
$errMsg
No constants found
log()
http()
http_get()
http_post()
setCache()
getCache()
removeCache()
$appid
$appsecret
$baseURL
$debug
$errCodeKey
$errMsgKey
$logcallback
N/A
No private methods found
No private properties found
N/A

Properties

$errCode

$errCode : 

Type

$errMsg

$errMsg : 

Type

$appid

$appid : 

Type

$appsecret

$appsecret : 

Type

$baseURL

$baseURL : 

Type

$debug

$debug : 

Type

$errCodeKey

$errCodeKey : 

Type

$errMsgKey

$errMsgKey : 

Type

$logcallback

$logcallback : 

Type

Methods

__construct()

__construct(  $options) 

Parameters

$options

log()

log(mixed  $log) : mixed

日志记录,可被重载。

Parameters

mixed $log

输入日志

Returns

mixed

http()

http(  $url, string  $data = '', string  $method = 'GET') : boolean|string

http请求

Parameters

$url
string $data
string $method

Returns

boolean|string

http_get()

http_get(string  $url, string|array  $param = '') : string|boolean

GET 请求

Parameters

string $url
string|array $param

Returns

string|boolean

http_post()

http_post(  $url,   $param = '',   $post_type) : string

POST 请求

Parameters

$url

string

$param

array|string

$post_type

int 发送编码方式(1 强制urlencoded)

Returns

string —

content

setCache()

setCache(string  $cachename, mixed  $value, integer  $expired) : boolean

设置缓存,按需重载

Parameters

string $cachename
mixed $value
integer $expired

Returns

boolean

getCache()

getCache(string  $cachename) : mixed

获取缓存,按需重载

Parameters

string $cachename

Returns

mixed

removeCache()

removeCache(string  $cachename) : boolean

清除缓存,按需重载

Parameters

string $cachename

Returns

boolean