PHP Class TTools\OAuthRequest

Afficher le fichier Open project: ttools/ttools

Protected Properties

Свойство Type Description
$boundary string
$consumerKey Application consumer key
$consumerSecret Application consumer secret
$headers array
$requestBody string
$token Request Token
$tokenSecret Request Secret
$userAgent Curl User Agent

Méthodes publiques

Méthode Description
__construct ( string $consumerKey, string $consumerSecret, string $token, string $tokenSecret ) Creates the OAuthRequest object
addHeader ( string $header )
buildHeaders ( $method, $url, $params = [], $multipart = false )
getConsumerKey ( ) : string
getConsumerSecret ( ) : string
getHeaders ( ) : mixed
getRequestBody ( ) : mixed
getToken ( ) : string
getTokenSecret ( ) : string
getUserAgent ( ) : string
request ( string $method, string $url, array $params = [], boolean $multipart = false ) : OAuthResponse Performs an authenticated OAuth Request
setConsumerKey ( string $consumerKey )
setConsumerSecret ( string $consumerSecret )
setHeaders ( mixed $headers )
setRequestBody ( mixed $requestBody )
setToken ( string $token )
setTokenSecret ( string $tokenSecret )
setUserAgent ( string $userAgent )

Méthodes protégées

Méthode Description
buildMultipartContent ( $file )
curlRequest ( string $url, array $params = [], string $method = 'GET', boolean $multipart = false ) : OAuthResponse Performs a OAuth curl request.
encodeParams ( array $params = [], boolean $quoted = false ) : array Encodes parameters
formatQueryString ( array $params ) : string
getOAuthHeader ( string $method, string $url, array $params = [], boolean $multipart = false ) : string Gets the OAuth signed Authorization headers
urlencodeRfc3986 ( $input ) : array | mixed | string

Method Details

__construct() public méthode

Creates the OAuthRequest object
public __construct ( string $consumerKey, string $consumerSecret, string $token, string $tokenSecret )
$consumerKey string Application Consumer Key
$consumerSecret string Application Consumer Secret
$token string Request Token
$tokenSecret string Request Token Secret

addHeader() public méthode

public addHeader ( string $header )
$header string

buildHeaders() public méthode

public buildHeaders ( $method, $url, $params = [], $multipart = false )

buildMultipartContent() protected méthode

protected buildMultipartContent ( $file )

curlRequest() protected méthode

Performs a OAuth curl request.
protected curlRequest ( string $url, array $params = [], string $method = 'GET', boolean $multipart = false ) : OAuthResponse
$url string
$params array
$method string
$multipart boolean
Résultat OAuthResponse

encodeParams() protected méthode

Encodes parameters
protected encodeParams ( array $params = [], boolean $quoted = false ) : array
$params array
$quoted boolean
Résultat array

formatQueryString() protected méthode

protected formatQueryString ( array $params ) : string
$params array
Résultat string

getConsumerKey() public méthode

public getConsumerKey ( ) : string
Résultat string

getConsumerSecret() public méthode

public getConsumerSecret ( ) : string
Résultat string

getHeaders() public méthode

public getHeaders ( ) : mixed
Résultat mixed

getOAuthHeader() protected méthode

Gets the OAuth signed Authorization headers
protected getOAuthHeader ( string $method, string $url, array $params = [], boolean $multipart = false ) : string
$method string
$url string
$params array
$multipart boolean
Résultat string

getRequestBody() public méthode

public getRequestBody ( ) : mixed
Résultat mixed

getToken() public méthode

public getToken ( ) : string
Résultat string

getTokenSecret() public méthode

public getTokenSecret ( ) : string
Résultat string

getUserAgent() public méthode

public getUserAgent ( ) : string
Résultat string

request() public méthode

Performs an authenticated OAuth Request
public request ( string $method, string $url, array $params = [], boolean $multipart = false ) : OAuthResponse
$method string Request Method (GET / POST)
$url string Request endpoint (e.g: /1.1/account/verify_credentials.json)
$params array Params for the request
$multipart boolean If the request is multipart or not (defaults to false)
Résultat OAuthResponse Returns an OAuthResponse object

setConsumerKey() public méthode

public setConsumerKey ( string $consumerKey )
$consumerKey string

setConsumerSecret() public méthode

public setConsumerSecret ( string $consumerSecret )
$consumerSecret string

setHeaders() public méthode

public setHeaders ( mixed $headers )
$headers mixed

setRequestBody() public méthode

public setRequestBody ( mixed $requestBody )
$requestBody mixed

setToken() public méthode

public setToken ( string $token )
$token string

setTokenSecret() public méthode

public setTokenSecret ( string $tokenSecret )
$tokenSecret string

setUserAgent() public méthode

public setUserAgent ( string $userAgent )
$userAgent string

urlencodeRfc3986() protected méthode

protected urlencodeRfc3986 ( $input ) : array | mixed | string
$input
Résultat array | mixed | string

Property Details

$boundary protected_oe property

protected string $boundary
Résultat string

$consumerKey protected_oe property

Application consumer key
protected $consumerKey

$consumerSecret protected_oe property

Application consumer secret
protected $consumerSecret

$headers protected_oe property

protected array $headers
Résultat array

$requestBody protected_oe property

protected string $requestBody
Résultat string

$token protected_oe property

Request Token
protected $token

$tokenSecret protected_oe property

Request Secret
protected $tokenSecret

$userAgent protected_oe property

Curl User Agent
protected $userAgent