Class Caller

Description

Calls API methods using REST requests.

Located in /src/caller/Caller.php (line 9)


	
			
Direct descendents
Class Description
CurlCaller Calls API methods using REST requests using cURL.
PeclCaller Calls API methods using REST requests using PECL HTTP.
SocketCaller Calls API methods using REST requests using PHP sockets.
Class Constant Summary
 API_URL = 'http://ws.audioscrobbler.com/2.0/'
Variable Summary
string $apiKey
string $apiSecret
Method Summary
static Caller getInstance ()
SimpleXMLElement call (string $method, [ $params = array()], [string $requestMethod = 'GET'])
string getApiKey ()
string getApiSecret ()
SimpleXMLElement internalCall ( $params, [string $requestMethod = 'GET'], string $query)
void setApiKey (string $apiKey)
void setApiSecret (string $apiSecret)
void setCache (Cache $cache)
SimpleXMLElement signedCall (string $method, [ $params = array()], [Session $session = null], [string $requestMethod = 'GET'])
Variables
string $apiKey (line 22)

Last.fm API key

  • access: protected
string $apiSecret (line 29)

Last.fm API secret

  • access: protected
Cache $cache (line 15)

A Cache instance

  • access: protected
Methods
static method getInstance (line 44)

Get a Caller instance.

  • return: A Caller instance.
  • abstract:
  • access: public
static Caller getInstance ()

Redefined in descendants as:
call (line 55)

Call an API method.

  • return: A SimpleXMLElement object.
  • access: public
SimpleXMLElement call (string $method, [ $params = array()], [string $requestMethod = 'GET'])
  • string $method: API method to call. (Required)
  • array $params: Request parameters to send. (Optional)
  • string $requestMethod: Request-method for calling (defaults to 'GET'). (Optional)
getApiKey (line 129)

Get the last.fm API key which is used.

  • return: A last.fm API key.
  • access: public
string getApiKey ()
getApiSecret (line 147)

Get the last.fm API secret which is used.

  • return: A last.fm API secret.
  • access: public
string getApiSecret ()
getCache (line 165)

Get the current Cache.

  • return: A Cache object.
  • access: public
Cache getCache ()
internalCall (line 113)

Send a query using a specified request-method.

  • return: A SimpleXMLElement object.
  • abstract:
  • access: protected
SimpleXMLElement internalCall ( $params, [string $requestMethod = 'GET'], string $query)
  • string $query: Query to send. (Required)
  • string $requestMethod: Request-method for calling (defaults to 'GET'). (Optional)
  • $params

Redefined in descendants as:
setApiKey (line 120)

Set the last.fm API key to be used.

  • access: public
void setApiKey (string $apiKey)
  • string $apiKey: A last.fm API key. (Required)
setApiSecret (line 138)

Set the last.fm API secret to be used.

  • access: public
void setApiSecret (string $apiSecret)
  • string $apiSecret: A last.fm API secret. (Required)
setCache (line 156)

Sets the active Cache (null to disable caching).

  • access: public
void setCache (Cache $cache)
  • Cache $cache: A Cache object. (Required)
signedCall (line 80)

Call an API method which needs to be signed.

  • return: A SimpleXMLElement object.
  • access: public
SimpleXMLElement signedCall (string $method, [ $params = array()], [Session $session = null], [string $requestMethod = 'GET'])
  • string $method: API method to call. (Required)
  • array $params: Request parameters to send. (Optional)
  • Session $session: A session obtained by getSession or getMobileSession. (Optional)
  • string $requestMethod: Request-method for calling (defaults to 'GET'). (Optional)
Class Constants
API_URL = 'http://ws.audioscrobbler.com/2.0/' (line 36)

Last.fm API base URL

  • access: public

Documentation generated on Mon, 22 Dec 2008 16:57:32 +0100 by phpDocumentor 1.4.1