Login |  Register 
Your PHP skills tool showed me were I needed to improve and how to do it!
Tom
 

RocksCache Class

Description

This class enables easy on disk caching of objects based on a key that is given to the RocksCache.

  • author: Dominic Skinner
  • version: 0.2.1

Located in /RocksCache.php (line 9)


	
			
Method Summary
RocksCache __construct (string $key, [string $cacheFolder = "_cache"])
boolean Cache (object $data)
boolean CacheExists ()
boolean DeleteCache ()
object ReadCache ()
Methods
Constructor __construct (line 20)

The constructor gives the cache its $key value, as well as allowing the default $cacheFolder to be overridden.

  • access: public
RocksCache __construct (string $key, [string $cacheFolder = "_cache"])
  • string $key: the key that will be used to write the cache on disk
  • string $cacheFolder: the location the cached item will be stored
Cache (line 32)

This function caches a object passed to it. It handles creating a new cache folder.

  • return: true if sucessful
  • access: public
boolean Cache (object $data)
  • object $data: this is the object to serialize
CacheExists (line 65)

This function indicates if a cache exists

  • return: true if the cache exists
  • access: public
boolean CacheExists ()
DeleteCache (line 56)

This function deletes the cached object

  • return: true if sucessful
  • access: public
boolean DeleteCache ()
ReadCache (line 46)

This function reads the cached object

  • access: public
object ReadCache ()

Comments to date: 1. Page 1 of 1. Average Rating:
Jodecy   1:12am on Monday, December 5th, 2011 
I can't believe I've been going for years without kowning that.

security image

Written by Dominic Skinner
Last Updated: 2011-10-25 16:00:38