PHP Класс Abraham\TwitterOAuth\TwitterOAuth

Автор: Abraham Williams ([email protected])
Наследование: extends Abraham\TwitterOAuth\Config
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $consumerKey, string $consumerSecret, string | null $oauthToken = null, string | null $oauthTokenSecret = null ) Constructor
delete ( string $path, array $parameters = [] ) : array | object Make DELETE requests to the API.
get ( string $path, array $parameters = [] ) : array | object Make GET requests to the API.
getLastApiPath ( ) : string | null
getLastBody ( ) : array | object | null
getLastHttpCode ( ) : integer
getLastXHeaders ( ) : array
oauth ( string $path, array $parameters = [] ) : array Make /oauth/* requests to the API.
oauth2 ( string $path, array $parameters = [] ) : array | object Make /oauth2/* requests to the API.
post ( string $path, array $parameters = [] ) : array | object Make POST requests to the API.
put ( string $path, array $parameters = [] ) : array | object Make PUT requests to the API.
resetLastResponse ( ) Resets the last response cache.
setOauthToken ( string $oauthToken, string $oauthTokenSecret )
upload ( string $path, array $parameters = [], boolean $chunked = false ) : array | object Upload media to upload.twitter.com.
url ( string $path, array $parameters ) : string Make URLs for user browser navigation.

Приватные методы

Метод Описание
encodeAppAuthorization ( Abraham\TwitterOAuth\Consumer $consumer ) : string Encode application authorization header with base64.
http ( string $method, string $host, string $path, array $parameters ) : array | object
oAuthRequest ( string $url, string $method, array $parameters ) : string Format and sign an OAuth / API request
parseHeaders ( string $header ) : array Get the header info to store.
pharRunning ( ) : boolean Is the code running from a Phar module.
request ( string $url, string $method, string $authorization, array $postfields ) : string Make an HTTP request
uploadMediaChunked ( string $path, array $parameters ) : array | object Private method to upload media (chunked) to upload.twitter.com.
uploadMediaNotChunked ( string $path, array $parameters ) : array | object Private method to upload media (not chunked) to upload.twitter.com.

Описание методов

__construct() публичный метод

Constructor
public __construct ( string $consumerKey, string $consumerSecret, string | null $oauthToken = null, string | null $oauthTokenSecret = null )
$consumerKey string The Application Consumer Key
$consumerSecret string The Application Consumer Secret
$oauthToken string | null The Client Token (optional)
$oauthTokenSecret string | null The Client Token Secret (optional)

delete() публичный метод

Make DELETE requests to the API.
public delete ( string $path, array $parameters = [] ) : array | object
$path string
$parameters array
Результат array | object

get() публичный метод

Make GET requests to the API.
public get ( string $path, array $parameters = [] ) : array | object
$path string
$parameters array
Результат array | object

getLastApiPath() публичный метод

public getLastApiPath ( ) : string | null
Результат string | null

getLastBody() публичный метод

public getLastBody ( ) : array | object | null
Результат array | object | null

getLastHttpCode() публичный метод

public getLastHttpCode ( ) : integer
Результат integer

getLastXHeaders() публичный метод

public getLastXHeaders ( ) : array
Результат array

oauth() публичный метод

Make /oauth/* requests to the API.
public oauth ( string $path, array $parameters = [] ) : array
$path string
$parameters array
Результат array

oauth2() публичный метод

Make /oauth2/* requests to the API.
public oauth2 ( string $path, array $parameters = [] ) : array | object
$path string
$parameters array
Результат array | object

post() публичный метод

Make POST requests to the API.
public post ( string $path, array $parameters = [] ) : array | object
$path string
$parameters array
Результат array | object

put() публичный метод

Make PUT requests to the API.
public put ( string $path, array $parameters = [] ) : array | object
$path string
$parameters array
Результат array | object

resetLastResponse() публичный метод

Resets the last response cache.
public resetLastResponse ( )

setOauthToken() публичный метод

public setOauthToken ( string $oauthToken, string $oauthTokenSecret )
$oauthToken string
$oauthTokenSecret string

upload() публичный метод

Upload media to upload.twitter.com.
public upload ( string $path, array $parameters = [], boolean $chunked = false ) : array | object
$path string
$parameters array
$chunked boolean
Результат array | object

url() публичный метод

Make URLs for user browser navigation.
public url ( string $path, array $parameters ) : string
$path string
$parameters array
Результат string