PHP 클래스 BaiduUtils, thinksns

저자: zhujianting([email protected])
파일 보기 프로젝트 열기: medz/thinksns-4 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$DROP_QUERY_PARAMS List of query parameters that get automatically dropped when rebuilding the current URL.

공개 메소드들

메소드 설명
errmsg ( ) : string Get the gloable error message.
errno ( ) : integer Get the gloable errno.
errorLog ( $msg ) Prints to the error log if you aren't in command line mode.
generateSign ( array $params, string $secret, string $namespace = 'sign' ) : string Generate the signature for passed parameters.
getCurrentUrl ( ) : string Get the url of current page.
isDebugMode ( ) : boolean Whether the debug mode of the Baidu OpenAPI SDK is on or off.
request ( string $url, array $params = [], string $httpMethod = 'GET', boolean $multi = false ) : string | false Request for a http/https resource
setDebugMode ( boolean $on = true ) Whether to set the debug mode of the Baidu OpenAPI SDK or not.
setError ( integer $errno, string $errmsg ) Set the gloable error number and error message.

비공개 메소드들

메소드 설명
buildHttpMultipartBody ( array $params ) : string Build the multipart body for file uploaded request.
detectMimeType ( $filename ) : string Tries to detect MIME type of a file
shouldRetainParam ( $param )

메소드 상세

errmsg() 공개 정적인 메소드

Get the gloable error message.
public static errmsg ( ) : string
리턴 string

errno() 공개 정적인 메소드

Get the gloable errno.
public static errno ( ) : integer
리턴 integer

errorLog() 공개 정적인 메소드

Prints to the error log if you aren't in command line mode.
public static errorLog ( $msg )

generateSign() 공개 정적인 메소드

Generate the signature for passed parameters.
public static generateSign ( array $params, string $secret, string $namespace = 'sign' ) : string
$params array Array of parameters to be signatured
$secret string Secret key for signature
$namespace string The parameter which will be excluded when calculate the signature
리턴 string Signature of the parameters

getCurrentUrl() 공개 정적인 메소드

Get the url of current page.
public static getCurrentUrl ( ) : string
리턴 string

isDebugMode() 공개 정적인 메소드

Whether the debug mode of the Baidu OpenAPI SDK is on or off.
public static isDebugMode ( ) : boolean
리턴 boolean

request() 공개 정적인 메소드

Request for a http/https resource
public static request ( string $url, array $params = [], string $httpMethod = 'GET', boolean $multi = false ) : string | false
$url string Url to request
$params array Parameters for the request
$httpMethod string Http method, 'GET' or 'POST'
$multi boolean Whether it's a multipart POST request
리턴 string | false Returns string if success, or false if failed

setDebugMode() 공개 정적인 메소드

Whether to set the debug mode of the Baidu OpenAPI SDK or not.
public static setDebugMode ( boolean $on = true )
$on boolean true or false

setError() 공개 정적인 메소드

Set the gloable error number and error message.
public static setError ( integer $errno, string $errmsg )
$errno integer Error code
$errmsg string Error message

프로퍼티 상세

$DROP_QUERY_PARAMS 보호되어 있는 정적으로 프로퍼티

List of query parameters that get automatically dropped when rebuilding the current URL.
protected static $DROP_QUERY_PARAMS