Property | Type | Description | |
---|---|---|---|
$DROP_QUERY_PARAMS | List of query parameters that get automatically dropped when rebuilding the current URL. |
Method | Description | |
---|---|---|
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. |
Method | Description | |
---|---|---|
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 ) |
public static errorLog ( $msg ) |
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 |
return | string | Signature of the parameters |
public static getCurrentUrl ( ) : string | ||
return | string |
public static isDebugMode ( ) : boolean | ||
return | boolean |
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 |
return | string | false | Returns string if success, or false if failed |
public static setDebugMode ( boolean $on = true ) | ||
$on | boolean | true or false |