Source for file MemoryCache.php
Documentation is available at MemoryCache.php
* @package php-lastfm-api
* @author Felix Bruns <felixbruns@web.de>
/** The array where the cache data is stored.
/** Constructor that sets up the MemoryCache.
/** Checks if data associated with a hash exists in the cache.
* @param string $hash The hash of the entry to be checked.
* @return boolean true if the entry exists, otherwise false.
/** Loads data from the cache.
* @param string $hash The hash of the entry to be loaded.
* @return string The cached data.
public function load($hash){
return $this->cache[$hash]['data'];
/** Removes data from the cache.
* @param string $hash The hash of the entry to be removed.
public function remove($hash){
unset
($this->cache[$hash]);
/** Stores data in the cache.
* @param string $hash The hash of the data to be stored.
* @param string $data The data to be stored.
* @param string $expiration The expiration time of the data (unix timestamp).
public function store($hash, $data, $expiration){
$this->cache[$hash] =
array(
'expiration' =>
$expiration
/** Removes all data from the cache.
/** Checks if data associated with a hash is expired.
* @param string $hash The hash of the entry to be checked.
* @return boolean true if the entry is expired, otherwise false.
$expiration =
$this->cache[$hash]['expiration'];
Documentation generated on Mon, 22 Dec 2008 16:57:40 +0100 by phpDocumentor 1.4.1