PHP Class TwitterOAuth\Auth\AuthAbstract

显示文件 Open project: ricardoper/twitteroauth Class Usage Examples

Protected Properties

Property Type Description
$call
$credentials
$curl
$getParams
$headers
$method
$postParams
$serializer
$withMedia

Public Methods

Method Description
__construct ( array $credentials, TwitterOAuth\Serializer\SerializerInterface $serializer ) Authentication Base
get ( string $call, array $getParams = null ) : mixed Send a GET call to Twitter API via OAuth
getConsumerKey ( ) : null | string Gets the Twitter API key
getConsumerSecret ( ) : null | string Gets the Twitter API secret
getCurl ( ) Get cURL Instance
getHeaders ( null $key = null ) : array | string | false Get response headers
getSerializer ( ) : null | TwitterOAuth\Serializer\SerializerInterface Gets Serializer

Protected Methods

Method Description
buildMultipart ( string $mimeBoundary, string $filename ) : string Build a multipart message
findExceptions ( array $response ) : string Processing Twitter Exceptions in case of error
getBinaryFile ( string $filename ) : string Get binary data of a file
getResponse ( ) : array Returns raw response body
getUrl ( ) : string Getting full URL from a Twitter resource
resetCallState ( ) Reset Call State
supportedMimes ( string $mime ) : mixed Twitter supported MIME types for media upload
validateCredentials ( $credentials ) Validate Credentials Array

Method Details

__construct() public method

Authentication Base
public __construct ( array $credentials, TwitterOAuth\Serializer\SerializerInterface $serializer )
$credentials array Credentials Array
$serializer TwitterOAuth\Serializer\SerializerInterface Output Serializer

buildMultipart() protected method

Build a multipart message
protected buildMultipart ( string $mimeBoundary, string $filename ) : string
$mimeBoundary string MIME boundary ID
$filename string File location
return string Multipart message

findExceptions() protected method

Processing Twitter Exceptions in case of error
protected findExceptions ( array $response ) : string
$response array Raw response
return string

get() public method

Send a GET call to Twitter API via OAuth
public get ( string $call, array $getParams = null ) : mixed
$call string Twitter resource string
$getParams array GET parameters to send
return mixed Output with selected format

getBinaryFile() protected method

Get binary data of a file
protected getBinaryFile ( string $filename ) : string
$filename string File location
return string

getConsumerKey() public method

Gets the Twitter API key
public getConsumerKey ( ) : null | string
return null | string

getConsumerSecret() public method

Gets the Twitter API secret
public getConsumerSecret ( ) : null | string
return null | string

getCurl() public method

Get cURL Instance
public getCurl ( )

getHeaders() public method

Get response headers
public getHeaders ( null $key = null ) : array | string | false
$key null
return array | string | false

getResponse() protected method

Returns raw response body
protected getResponse ( ) : array
return array

getSerializer() public method

Gets Serializer
public getSerializer ( ) : null | TwitterOAuth\Serializer\SerializerInterface
return null | TwitterOAuth\Serializer\SerializerInterface

getUrl() protected method

Getting full URL from a Twitter resource
protected getUrl ( ) : string
return string Full URL

resetCallState() protected method

Reset Call State
protected resetCallState ( )

supportedMimes() protected method

Twitter supported MIME types for media upload
protected supportedMimes ( string $mime ) : mixed
$mime string File extension
return mixed MIME type

validateCredentials() protected method

Validate Credentials Array
protected validateCredentials ( $credentials )
$credentials

Property Details

$call protected_oe property

protected $call

$credentials protected_oe property

protected $credentials

$curl protected_oe property

protected $curl

$getParams protected_oe property

protected $getParams

$headers protected_oe property

protected $headers

$method protected_oe property

protected $method

$postParams protected_oe property

protected $postParams

$serializer protected_oe property

protected $serializer

$withMedia protected_oe property

protected $withMedia