PHP Class WeiboOAuth

ファイルを表示 Open project: hybridauth/hybridauth Class Usage Examples

Public Properties

Property Type Description
$connecttimeout Set connect timeout.
$decode_json Decode returned json data.
$format Response format.
$host Set up the API root URL.
$http_code Contains the last HTTP status code returned.
$http_info Contains the last HTTP headers returned.
$ssl_verifypeer Verify SSL Cert.
$timeout Set timeout default.
$url Contains the last API call.

Public Methods

Method Description
__construct ( $consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL ) construct WeiboOAuth object
accessTokenURL ( )
authenticateURL ( )
delete ( $url, $parameters = [] ) : mixed DELTE wrapper for oAuthReqeust.
get ( $url, $parameters = [] ) : mixed GET wrapper for oAuthRequest.
getAccessToken ( $oauth_verifier = FALSE, $oauth_token = false ) : array Exchange the request token and secret for an access token and secret, to sign API calls.
getAuthorizeURL ( $token ) *function getAuthorizeURL($token, $url) { if (is_array($token)) { $token = $token['oauth_token']; }
getHeader ( $ch, $header ) : integer Get the header info to store.
getRequestToken ( $oauth_callback = NULL ) : array Get a request_token from Weibo
http ( $url, $method, $postfields = NULL, $multi = false ) : string Make an HTTP request
lastAPICall ( )
lastStatusCode ( )
oAuthRequest ( $url, $method, $parameters, $multi = false ) : string Format and sign an OAuth / API request
post ( $url, $parameters = [], $multi = false ) : mixed POST wrapper for oAuthRequest.
requestTokenURL ( )
request_with_uid ( $url, $uid_or_name = null, $page = false, $count = false, $cursor = false, $post = false )

Method Details

__construct() public method

construct WeiboOAuth object
public __construct ( $consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL )

accessTokenURL() public method

public accessTokenURL ( )

authenticateURL() public method

public authenticateURL ( )

delete() public method

DELTE wrapper for oAuthReqeust.
public delete ( $url, $parameters = [] ) : mixed
return mixed

get() public method

GET wrapper for oAuthRequest.
public get ( $url, $parameters = [] ) : mixed
return mixed

getAccessToken() public method

Exchange the request token and secret for an access token and secret, to sign API calls.
public getAccessToken ( $oauth_verifier = FALSE, $oauth_token = false ) : array
return array array("oauth_token" => the access token, "oauth_token_secret" => the access secret)

getAuthorizeURL() public method

return $this->authorizeURL() . "?oauth_token={$token}&oauth_callback=" . urlencode($url); }
public getAuthorizeURL ( $token )

getHeader() public method

Get the header info to store.
public getHeader ( $ch, $header ) : integer
return integer

getRequestToken() public method

Get a request_token from Weibo
public getRequestToken ( $oauth_callback = NULL ) : array
return array a key/value array containing oauth_token and oauth_token_secret

http() public method

Make an HTTP request
public http ( $url, $method, $postfields = NULL, $multi = false ) : string
return string API results

lastAPICall() public method

public lastAPICall ( )

lastStatusCode() public method

public lastStatusCode ( )

oAuthRequest() public method

Format and sign an OAuth / API request
public oAuthRequest ( $url, $method, $parameters, $multi = false ) : string
return string

post() public method

POST wrapper for oAuthRequest.
public post ( $url, $parameters = [], $multi = false ) : mixed
return mixed

requestTokenURL() public method

public requestTokenURL ( )

request_with_uid() public method

public request_with_uid ( $url, $uid_or_name = null, $page = false, $count = false, $cursor = false, $post = false )

Property Details

$connecttimeout public_oe property

Set connect timeout.
public $connecttimeout

$decode_json public_oe property

Decode returned json data.
public $decode_json

$format public_oe property

Response format.
public $format

$host public_oe property

Set up the API root URL.
public $host

$http_code public_oe property

Contains the last HTTP status code returned.
public $http_code

$http_info public_oe property

Contains the last HTTP headers returned.
public $http_info

$ssl_verifypeer public_oe property

Verify SSL Cert.
public $ssl_verifypeer

$timeout public_oe property

Set timeout default.
public $timeout

$url public_oe property

Contains the last API call.
public $url