Andrew's Web Libraries (AWL)
 All Classes Namespaces Functions Variables Pages
AwlCache Class Reference

Public Member Functions

 __construct ()
 
 isActive ()
 
 get ($namespace, $key)
 
 set ($namespace, $key, $value, $expiry=864000)
 
 delete ($namespace, $key)
 
 flush ()
 
 acquireLock ($something, $wait_for=5)
 
 releaseLock ($something)
 

Private Member Functions

 nskey ($namespace, $key)
 

Static Private Attributes

static $m
 
static $servers
 
static $working
 

Detailed Description

A simple Memcached wrapper supporting namespacing of stored values.

Author
Andrew McMillan LGPL v2 or later

Definition at line 10 of file AwlCache.php.

Constructor & Destructor Documentation

AwlCache::__construct ( )

Initialise the cache connection. We use getpid() to give us a persistent connection.

Definition at line 18 of file AwlCache.php.

Member Function Documentation

AwlCache::acquireLock (   $something,
  $wait_for = 5 
)

Acquire a lock on something

Definition at line 147 of file AwlCache.php.

AwlCache::delete (   $namespace,
  $key 
)

Delete a value from a namespace/key, or for everything in a namespace if a 'null' key is supplied.

Parameters
$namespace
$key

Definition at line 116 of file AwlCache.php.

AwlCache::flush ( )

Flush the entire cache

Definition at line 137 of file AwlCache.php.

AwlCache::get (   $namespace,
  $key 
)

get a value from the specified namespace / key

Parameters
$namespace
$key

Definition at line 66 of file AwlCache.php.

AwlCache::isActive ( )

So we can find out if we are actually using the cache.

Definition at line 48 of file AwlCache.php.

AwlCache::nskey (   $namespace,
  $key 
)
private

Construct a string from the namespace & key

Parameters
unknown_type$namespace
unknown_type$key

Definition at line 57 of file AwlCache.php.

AwlCache::releaseLock (   $something)

Release a lock

Definition at line 160 of file AwlCache.php.

AwlCache::set (   $namespace,
  $key,
  $value,
  $expiry = 864000 
)

Set a value for the specified namespace/key, perhaps with an expiry (default 10 days)

Parameters
$namespace
$key
$value
$expiry

Definition at line 82 of file AwlCache.php.


The documentation for this class was generated from the following file: