DBABagOStuff Class Reference
[Cache]

Cache that uses DBA as a backend. More...

Inherits BagOStuff.

List of all members.

Public Member Functions

 __construct ($dir=false)
 encode ($value, $expiry)
 Encode value and expiry for storage.
 decode ($blob)
 getReader ()
 getWriter ()
 get ($key)
 Get an item with the given key.
 set ($key, $value, $exptime=0)
 Set an item.
 delete ($key, $time=0)
 add ($key, $value, $exptime=0)
 keys ()

Public Attributes

 $mHandler
 $mFile
 $mReader
 $mWriter
 $mDisabled


Detailed Description

Cache that uses DBA as a backend.

Slow due to the need to constantly open and close the file to avoid holding writer locks. Intended for development use only, as a memcached workalike for systems that don't have it.

Definition at line 592 of file BagOStuff.php.


Constructor & Destructor Documentation

DBABagOStuff::__construct ( dir = false  ) 

Definition at line 595 of file BagOStuff.php.

References $wgDBAhandler, $wgTmpDirectory, wfDebug(), and wfWikiID().


Member Function Documentation

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

Reimplemented from BagOStuff.

Definition at line 701 of file BagOStuff.php.

References $blob, decode(), encode(), getWriter(), wfProfileIn(), and wfProfileOut().

DBABagOStuff::decode ( blob  ) 

Returns:
list containing value first and expiry second

Definition at line 619 of file BagOStuff.php.

References $blob.

Referenced by add(), and get().

DBABagOStuff::delete ( key,
time = 0 
)

Reimplemented from BagOStuff.

Definition at line 688 of file BagOStuff.php.

References getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().

DBABagOStuff::encode ( value,
expiry 
)

Encode value and expiry for storage.

Definition at line 610 of file BagOStuff.php.

References BagOStuff::convertExpiry().

Referenced by add(), and set().

DBABagOStuff::get ( key  ) 

Get an item with the given key.

Returns false if it does not exist.

Parameters:
$key string

Reimplemented from BagOStuff.

Definition at line 650 of file BagOStuff.php.

References decode(), getReader(), getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().

DBABagOStuff::getReader (  ) 

Definition at line 630 of file BagOStuff.php.

References getWriter(), and wfDebug().

Referenced by get(), and keys().

DBABagOStuff::getWriter (  ) 

Definition at line 642 of file BagOStuff.php.

References wfDebug().

Referenced by add(), delete(), get(), getReader(), and set().

DBABagOStuff::keys (  ) 

Reimplemented from BagOStuff.

Definition at line 725 of file BagOStuff.php.

References $reader, $result, and getReader().

DBABagOStuff::set ( key,
value,
exptime = 0 
)

Set an item.

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

Reimplemented from BagOStuff.

Definition at line 674 of file BagOStuff.php.

References $blob, encode(), getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().


Member Data Documentation

DBABagOStuff::$mDisabled

Definition at line 593 of file BagOStuff.php.

DBABagOStuff::$mFile

Definition at line 593 of file BagOStuff.php.

DBABagOStuff::$mHandler

Definition at line 593 of file BagOStuff.php.

DBABagOStuff::$mReader

Definition at line 593 of file BagOStuff.php.

DBABagOStuff::$mWriter

Definition at line 593 of file BagOStuff.php.


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

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