Andrew's Web Libraries (AWL)
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 @license LGPL v2 or later

Definition at line 10 of file AwlCache.php.

Constructor & Destructor Documentation

◆ __construct()

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

◆ acquireLock()

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

Acquire a lock on something

Definition at line 189 of file AwlCache.php.

◆ delete()

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 149 of file AwlCache.php.

◆ flush()

AwlCache::flush ( )

Flush the entire cache

Definition at line 179 of file AwlCache.php.

◆ get()

AwlCache::get (   $namespace,
  $key 
)

get a value from the specified namespace / key

Parameters
$namespace
$key

Definition at line 75 of file AwlCache.php.

◆ isActive()

AwlCache::isActive ( )

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

Definition at line 57 of file AwlCache.php.

◆ nskey()

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

Construct a string from the namespace & key

Parameters
unknown_type$namespace
unknown_type$key

Definition at line 66 of file AwlCache.php.

◆ releaseLock()

AwlCache::releaseLock (   $something)

Release a lock

Definition at line 202 of file AwlCache.php.

◆ set()

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 91 of file AwlCache.php.

Member Data Documentation

◆ $m

AwlCache::$m
staticprivate

Definition at line 11 of file AwlCache.php.

◆ $servers

AwlCache::$servers
staticprivate

Definition at line 12 of file AwlCache.php.

◆ $working

AwlCache::$working
staticprivate

Definition at line 13 of file AwlCache.php.


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