PHP 클래스 TTools\TTools

파일 보기 프로젝트 열기: ttools/ttools 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $config )
getAccessTokens ( string $request_token, string $request_secret, string $oauth_verifier ) : array Makes a Request to get the user access tokens
getAuthorizeUrl ( array $params = [] ) : array Gets the authorization url.
getLastReqInfo ( ) : array
getUserTokens ( ) : array Gets the current user tokens
handleError ( OAuthResponse $response ) : array
makeRequest ( $url, array $params = [], string $method = 'GET', boolean $multipart = false ) : array | mixed
setUserTokens ( string $at, string $ats ) Sets the current user tokens
uploadMedia ( string $image ) : array | mixed

비공개 메소드들

메소드 설명
OAuthRequest ( $url, array $params = [], string $method = 'GET', null $callback = null, boolean $multipart = false ) : array | OAuthResponse
parseResponse ( $string ) : array

메소드 상세

__construct() 공개 메소드

public __construct ( array $config )
$config array

getAccessTokens() 공개 메소드

Makes a Request to get the user access tokens
public getAccessTokens ( string $request_token, string $request_secret, string $oauth_verifier ) : array
$request_token string
$request_secret string
$oauth_verifier string
리턴 array Returns an array with the user data and tokens, or an error array with code and message

getAuthorizeUrl() 공개 메소드

Gets the authorization url.
public getAuthorizeUrl ( array $params = [] ) : array
$params array Custom parameters passed to the OAuth request
리턴 array If successful, returns an array with 'auth_url', 'secret' and 'token'; otherwise, returns an array with error code and message.

getLastReqInfo() 공개 메소드

public getLastReqInfo ( ) : array
리턴 array

getUserTokens() 공개 메소드

Gets the current user tokens
public getUserTokens ( ) : array
리턴 array Returns an array where the first position is the Access Token and the second position is the Access Token Secret

handleError() 공개 메소드

public handleError ( OAuthResponse $response ) : array
$response OAuthResponse
리턴 array

makeRequest() 공개 메소드

public makeRequest ( $url, array $params = [], string $method = 'GET', boolean $multipart = false ) : array | mixed
$url
$params array
$method string
$multipart boolean
리턴 array | mixed

setUserTokens() 공개 메소드

Sets the current user tokens
public setUserTokens ( string $at, string $ats )
$at string Access Token
$ats string Access Token Secret

uploadMedia() 공개 메소드

public uploadMedia ( string $image ) : array | mixed
$image string Path to the image
리턴 array | mixed