Class Cache

Description

A cache.

Located in /src/cache/Cache.php (line 9)


	
			
Direct descendents
Class Description
DiskCache A disk cache.
MemoryCache A memory cache.
SqliteCache A SQLite database cache.
Method Summary
static string createHash (array $params)
Cache __construct ()
void clear ()
boolean contains (string $hash)
boolean isExpired (string $hash)
string load (string $hash)
void remove (string $hash)
void setPolicy (CachePolicy $policy)
void store (string $hash, string $data, string $expiration)
Methods
static method createHash (line 99)

Creates a hash from last.fm API request parameters.

  • return: A calculated hexadecimal SHA1 hash.
  • access: public
static string createHash (array $params)
  • array $params: An associative array of last.fm API request parameters.
Constructor __construct (line 21)

Protected constructor that sets a DefaultCachePolicy.

  • access: protected
Cache __construct ()

Redefined in descendants as:
clear (line 89)

Removes all data from the cache.

  • abstract:
  • access: public
void clear ()

Redefined in descendants as:
contains (line 51)

Checks if data associated with a hash exists in the cache.

  • return: true if the entry exists, otherwise false.
  • abstract:
  • access: public
boolean contains (string $hash)
  • string $hash: The hash of the entry to be checked.

Redefined in descendants as:
getPolicy (line 31)

Returns the CachePolicy that's used.

  • return: A CachePolicy object.
  • see: CachePolicy
  • access: public
CachePolicy getPolicy ()
isExpired (line 83)

Checks if data associated with a hash is expired.

  • return: true if the entry is expired, otherwise false.
  • abstract:
  • access: public
boolean isExpired (string $hash)
  • string $hash: The hash of the entry to be checked.

Redefined in descendants as:
load (line 59)

Loads data from the cache.

  • return: The cached data.
  • abstract:
  • access: public
string load (string $hash)
  • string $hash: The hash of the entry to be loaded.

Redefined in descendants as:
remove (line 66)

Removes data from the cache.

  • abstract:
  • access: public
void remove (string $hash)
  • string $hash: The hash of the entry to be removed.

Redefined in descendants as:
setPolicy (line 41)

Sets the CachePolicy to be used.

void setPolicy (CachePolicy $policy)
store (line 75)

Stores data in the cache.

  • abstract:
  • access: public
void store (string $hash, string $data, string $expiration)
  • string $hash: The hash of the data to be stored.
  • string $data: The data to be stored.
  • string $expiration: The expiration time of the data (unix timestamp).

Redefined in descendants as:

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