Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /usr/local/Cellar/php53/5.3.13/lib/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class Cache

Class Cache

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /usr/local/Cellar/php53/5.3.13/lib/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Cache Class

Wrapper class for Memcache() to allow for better error handling when the Memcached server is unavailable. Designed around the syntax for Memcached() to allow for an easier transistion to the aforementioned in the future. I don't entirely remember specifics, but the reason for not using Memcached() was due to an unexplainable bug in the version in the repository for Ubuntu 10.04 LTS. Memcached() does support more of the memcached protocol and will eventually be what PICKLES uses.

Requires php5-memcache

Located in /classes/Cache.php (line 35)

Object
   |
   --Cache
Method Summary
static object self::$instance getInstance ([string $class = 'Cache'])
Cache __construct ([string $hostname = null], [ $port = null], string $database)
void __destruct ()
boolean delete (string $key)
mixed get (string $key)
boolean increment (string $key)
void open ()
boolean set (string $key, mixed $value, [ $expire = 300], integer $expiration)
Methods
Strict Standards: Only variables should be passed by reference in /usr/local/Cellar/php53/5.3.13/lib/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Strict Standards: Only variables should be passed by reference in /usr/local/Cellar/php53/5.3.13/lib/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /usr/local/Cellar/php53/5.3.13/lib/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
static method getInstance (line 110)

Get Instance

Let's the parent class do all the work.

  • return: instance of the Cache class
  • access: public
static object self::$instance getInstance ([string $class = 'Cache'])
  • string $class: name of the class to instantiate
Constructor __construct (line 69)

Constructor

Sets up our connection variables.

  • access: public
Cache __construct ([string $hostname = null], [ $port = null], string $database)
  • string $hostname: optional hostname to connect to
  • string $database: optional port to use
  • $port
Destructor __destruct (line 93)

Destructor

Closes the connection when the object dies.

  • access: public
void __destruct ()
delete (line 181)

Delete Key

Deletes the specified key.

  • return: status of deleting the key
  • access: public
boolean delete (string $key)
  • string $key: key to delete
get (line 139)

Get Key

Gets the value of the key and returns it.

  • return: value of the requested key, false if not set
  • access: public
mixed get (string $key)
  • string $key: key to retrieve
increment (line 200)

Increment Key

Increments the value of an existing key.

  • return: status of incrementing the key
  • todo: Wondering if I should check the key and set to 1 if it's new
  • access: public
boolean increment (string $key)
  • string $key: key to increment
open (line 120)

Opens Connection

Establishes a connection to the memcached server.

  • access: public
void open ()
set (line 163)

Set Key

Sets key to the specified value. I've found that compression can lead to issues with integers and can slow down the storage and retrieval of data (defeats the purpose of caching if you ask me) and isn't supported. I've also been burned by data inadvertantly being cached for infinity, hence the 5 minute default.

  • return: status of writing the data to the key
  • access: public
boolean set (string $key, mixed $value, [ $expire = 300], integer $expiration)
  • string $key: key to set
  • mixed $value: value to set
  • integer $expiration: optional expiration, defaults to 5 minutes
  • $expire

Documentation generated on Wed, 03 Oct 2012 17:46:05 -0400 by phpDocumentor 1.4.4