\Horde_Service_Twitter

Horde_Service_Twitter class abstracts communication with Twitter's rest interface.

Summary

Methods
Properties
Constants
__construct()
create()
setCache()
setLogger()
setHttpClient()
getHttpClient()
__get()
$account
$statuses
$auth
$request
$responseCache
$cacheLifetime
REQUEST_TOKEN_URL
USER_AUTHORIZE_URL
ACCESS_TOKEN_URL
No protected methods found
$_objCache
$_responseCache
$_cacheLifetime
$_logger
$_auth
$_request
$_httpClient
N/A
No private methods found
No private properties found
N/A

Constants

REQUEST_TOKEN_URL

REQUEST_TOKEN_URL

USER_AUTHORIZE_URL

USER_AUTHORIZE_URL

ACCESS_TOKEN_URL

ACCESS_TOKEN_URL

Properties

$account

$account : \Horde_Service_Twitter_Account

The twitter account object for calling account methods.

Type

\Horde_Service_Twitter_Account

$statuses

$statuses : \Horde_Service_Twitter_Statuses

The twitter status object for updating and retrieving user statuses.

Type

\Horde_Service_Twitter_Statuses

$auth

$auth : \Horde_Service_Twitter_Auth

The twitter authentication object.

Type

\Horde_Service_Twitter_Auth

$request

$request : \Horde_Service_Twitter_Request

The twitter request object that wraps sending requests to Twitter's REST API.

Type

\Horde_Service_Twitter_Request

$responseCache

$responseCache : \Horde_Cache

The cache object.

Type

\Horde_Cache

$cacheLifetime

$cacheLifetime : integer

The default cache lifetime.

Type

integer

$_objCache

$_objCache : \hash

Cache for the various objects we lazy load in __get()

Type

\hash — of Horde_Service_Twitter_* objects

$_responseCache

$_responseCache : \Horde_Cache

(Optional) Cache object.

Type

\Horde_Cache

$_cacheLifetime

$_cacheLifetime : integer

Default cache lifetime.

Type

integer

$_logger

$_logger : \Horde_Log_Logger

Optional logger.

Type

\Horde_Log_Logger

$_auth

$_auth : \Horde_Service_Twitter_Auth

Can't lazy load the auth or request class since we need to know early if we are OAuth or Basic

Type

\Horde_Service_Twitter_Auth

$_httpClient

$_httpClient : \Horde_Http_Client

The http client.

Type

\Horde_Http_Client

Methods

create()

create(array  $params) : \Horde_Service_Twitter

Factory method to easily build a working Twitter client object.

Parameters

array $params

Configuration parameters, with the following keys:

  • 'oauth' (required):
  • 'consumer_key' (required): The application's consumer key
  • 'consumer_secret' (required): The application's consumer secret
  • 'access_token' (optional): The user's access token
  • 'access_token_secret' (optional): The user's access token secret.
  • 'http' (optional): any configuration parameters for Horde_Http_Client, e.g. proxy settings.

Returns

\Horde_Service_Twitter

A twitter object that can be used immediately to update and receive statuses etc.

setCache()

setCache(\Horde_Cache  $cache) 

Parameters

\Horde_Cache $cache

setLogger()

setLogger(\Horde_Log_Logger  $logger) 

Parameters

\Horde_Log_Logger $logger

setHttpClient()

setHttpClient(\Horde_Http_Client  $client) 

Set the http client.

Parameters

\Horde_Http_Client $client

The http client

getHttpClient()

getHttpClient() : \Horde_Http_Client

Get the http client.

Returns

\Horde_Http_Client

__get()

__get(string  $value) : \Horde_Service_Twitter_*

Lazy load the twitter classes.

Parameters

string $value

The lowercase representation of the subclass.

Throws

\Horde_Service_Twitter_Exception

Returns

\Horde_Service_Twitter_* —

object.