MediaWiki  REL1_19
DBABagOStuff Class Reference

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

Inheritance diagram for DBABagOStuff:
Collaboration diagram for DBABagOStuff:

List of all members.

Public Member Functions

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

Public Attributes

 $mDisabled
 $mFile
 $mHandler
 $mReader
 $mWriter

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.

On construction you can pass array( 'dir' => '/some/path' ); as a parameter to override the default DBA files directory (wgTmpDirectory).

Definition at line 14 of file DBABagOStuff.php.


Constructor & Destructor Documentation

Definition at line 17 of file DBABagOStuff.php.

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

Here is the call graph for this function:


Member Function Documentation

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

Reimplemented from BagOStuff.

Definition at line 148 of file DBABagOStuff.php.

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

Here is the call graph for this function:

DBABagOStuff::decode ( blob)
Returns:
array list containing value first and expiry second

Definition at line 48 of file DBABagOStuff.php.

References $blob.

Referenced by add(), and get().

Here is the caller graph for this function:

DBABagOStuff::delete ( key,
time = 0 
)

Delete an item.

Parameters:
$keystring
$timeint Amount of time to delay the operation (mostly memcached-specific)

Reimplemented from BagOStuff.

Definition at line 131 of file DBABagOStuff.php.

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

Here is the call graph for this function:

DBABagOStuff::encode ( value,
expiry 
)

Encode value and expiry for storage.

Parameters:
$value
$expiry
Returns:
string

Definition at line 38 of file DBABagOStuff.php.

References BagOStuff\convertExpiry().

Referenced by add(), and set().

Here is the call graph for this function:

Here is the caller graph for this function:

DBABagOStuff::get ( key)

Get an item with the given key.

Returns false if it does not exist.

Parameters:
$keystring
Returns:
bool|Object

Reimplemented from BagOStuff.

Definition at line 83 of file DBABagOStuff.php.

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

Here is the call graph for this function:

Definition at line 59 of file DBABagOStuff.php.

References getWriter(), and wfDebug().

Referenced by get(), and keys().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 73 of file DBABagOStuff.php.

References wfDebug().

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

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from BagOStuff.

Definition at line 180 of file DBABagOStuff.php.

References $result, and getReader().

Here is the call graph for this function:

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

Set an item.

Parameters:
$keystring
$valuemixed
$exptimeint Either an interval in seconds or a unix timestamp for expiry

Reimplemented from BagOStuff.

Definition at line 112 of file DBABagOStuff.php.

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

Here is the call graph for this function:


Member Data Documentation

DBABagOStuff::$mDisabled

Definition at line 15 of file DBABagOStuff.php.

DBABagOStuff::$mFile

Definition at line 15 of file DBABagOStuff.php.

DBABagOStuff::$mHandler

Definition at line 15 of file DBABagOStuff.php.

DBABagOStuff::$mReader

Definition at line 15 of file DBABagOStuff.php.

DBABagOStuff::$mWriter

Definition at line 15 of file DBABagOStuff.php.


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