BagOStuff Class Reference
[Cache]

interface is intended to be more or less compatible with the PHP memcached client. More...

Inherited by APCBagOStuff, DBABagOStuff, eAccelBagOStuff, HashBagOStuff, SqlBagOStuff, and XCacheBagOStuff.

List of all members.

Public Member Functions

 set_debug ($bool)
 get ($key)
 Get an item with the given key.
 set ($key, $value, $exptime=0)
 Set an item.
 delete ($key, $time=0)
 lock ($key, $timeout=0)
 unlock ($key)
 keys ()
 get_multi ($keys)
 set_multi ($hash, $exptime=0)
 add ($key, $value, $exptime=0)
 add_multi ($hash, $exptime=0)
 delete_multi ($keys, $time=0)
 replace ($key, $value, $exptime=0)
 incr ($key, $value=1)
 decr ($key, $value=1)
 debug ($text)

Public Attributes

 $debugMode = false

Protected Member Functions

 convertExpiry ($exptime)
 Convert an optionally relative time to an absolute time.


Detailed Description

interface is intended to be more or less compatible with the PHP memcached client.

backends for local hash array and SQL table included: $bag = new HashBagOStuff(); $bag = new SqlBagOStuff(); # connect to db first

Definition at line 40 of file BagOStuff.php.


Member Function Documentation

BagOStuff::add ( key,
value,
exptime = 0 
)

Reimplemented in DBABagOStuff.

Definition at line 104 of file BagOStuff.php.

Referenced by add_multi().

BagOStuff::add_multi ( hash,
exptime = 0 
)

Definition at line 111 of file BagOStuff.php.

References add().

BagOStuff::convertExpiry ( exptime  )  [protected]

Convert an optionally relative time to an absolute time.

Definition at line 156 of file BagOStuff.php.

Referenced by DBABagOStuff::encode(), and HashBagOStuff::set().

BagOStuff::debug ( text  ) 

Definition at line 148 of file BagOStuff.php.

References wfDebug().

Referenced by SqlBagOStuff::get().

BagOStuff::decr ( key,
value = 1 
)

Definition at line 144 of file BagOStuff.php.

References incr().

BagOStuff::delete ( key,
time = 0 
) [abstract]

BagOStuff::delete_multi ( keys,
time = 0 
)

Definition at line 117 of file BagOStuff.php.

References $keys.

BagOStuff::get ( key  )  [abstract]

Get an item with the given key.

Returns false if it does not exist.

Parameters:
$key string

Reimplemented in HashBagOStuff, SqlBagOStuff, APCBagOStuff, eAccelBagOStuff, XCacheBagOStuff, and DBABagOStuff.

BagOStuff::get_multi ( keys  ) 

Definition at line 88 of file BagOStuff.php.

References $keys, and $out.

BagOStuff::incr ( key,
value = 1 
)

Reimplemented in SqlBagOStuff.

Definition at line 129 of file BagOStuff.php.

References $n, lock(), and unlock().

Referenced by decr().

BagOStuff::keys (  ) 

Reimplemented in HashBagOStuff, SqlBagOStuff, APCBagOStuff, and DBABagOStuff.

Definition at line 81 of file BagOStuff.php.

BagOStuff::lock ( key,
timeout = 0 
)

Reimplemented in eAccelBagOStuff.

Definition at line 71 of file BagOStuff.php.

Referenced by incr().

BagOStuff::replace ( key,
value,
exptime = 0 
)

Definition at line 123 of file BagOStuff.php.

BagOStuff::set ( key,
value,
exptime = 0 
) [abstract]

Set an item.

Parameters:
$key string
$value mixed
$exptime int Either an interval in seconds or a unix timestamp for expiry

Reimplemented in HashBagOStuff, SqlBagOStuff, APCBagOStuff, eAccelBagOStuff, XCacheBagOStuff, and DBABagOStuff.

BagOStuff::set_debug ( bool  ) 

Definition at line 43 of file BagOStuff.php.

BagOStuff::set_multi ( hash,
exptime = 0 
)

Definition at line 98 of file BagOStuff.php.

BagOStuff::unlock ( key  ) 

Reimplemented in eAccelBagOStuff.

Definition at line 76 of file BagOStuff.php.

Referenced by incr().


Member Data Documentation

BagOStuff::$debugMode = false

Definition at line 41 of file BagOStuff.php.


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

Generated on Sat Apr 30 22:57:33 2011 for MediaWiki by  doxygen 1.5.9