SqlBagOStuff Class Reference
[Cache]

Class to store objects in the database. More...

Inherits BagOStuff.

Inherited by MediaWikiBagOStuff.

List of all members.

Public Member Functions

 get ($key)
 Get an item with the given key.
 set ($key, $value, $exptime=0)
 Set an item.
 delete ($key, $time=0)
 incr ($key, $step=1)
 keys ()
 expireAll ()
 deleteAll ()

Public Attributes

 $lb
 $db
 $lastExpireAll = 0

Protected Member Functions

 getDB ()
 isExpired ($exptime)
 getMaxDateTime ()
 garbageCollect ()
 serialize (&$data)
 Serialize an object and, if possible, compress the representation.
 unserialize ($serial)
 Unserialize and, if necessary, decompress an object.
 handleWriteError ($exception)
 Handle a DBQueryError which occurred during a write operation.


Detailed Description

Class to store objects in the database.

Definition at line 220 of file BagOStuff.php.


Member Function Documentation

SqlBagOStuff::delete ( key,
time = 0 
)

Reimplemented from BagOStuff.

Definition at line 302 of file BagOStuff.php.

References $db, getDB(), and handleWriteError().

SqlBagOStuff::deleteAll (  ) 

Definition at line 397 of file BagOStuff.php.

References $db, getDB(), and handleWriteError().

SqlBagOStuff::expireAll (  ) 

Definition at line 385 of file BagOStuff.php.

References $db, getDB(), and handleWriteError().

Referenced by garbageCollect().

SqlBagOStuff::garbageCollect (  )  [protected]

Definition at line 373 of file BagOStuff.php.

References expireAll().

Referenced by get().

SqlBagOStuff::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 242 of file BagOStuff.php.

References $db, BagOStuff::debug(), garbageCollect(), getDB(), handleWriteError(), isExpired(), and unserialize().

SqlBagOStuff::getDB (  )  [protected]

SqlBagOStuff::getMaxDateTime (  )  [protected]

Definition at line 365 of file BagOStuff.php.

References getDB().

Referenced by isExpired(), and set().

SqlBagOStuff::handleWriteError ( exception  )  [protected]

Handle a DBQueryError which occurred during a write operation.

Ignore errors which are due to a read-only database, rethrow others.

Definition at line 445 of file BagOStuff.php.

References $db, getDB(), and wfDebug().

Referenced by delete(), deleteAll(), expireAll(), get(), incr(), and set().

SqlBagOStuff::incr ( key,
step = 1 
)

Reimplemented from BagOStuff.

Definition at line 315 of file BagOStuff.php.

References $db, $step, getDB(), handleWriteError(), isExpired(), and unserialize().

SqlBagOStuff::isExpired ( exptime  )  [protected]

Definition at line 361 of file BagOStuff.php.

References getMaxDateTime(), and wfTimestamp().

Referenced by get(), and incr().

SqlBagOStuff::keys (  ) 

Reimplemented from BagOStuff.

Definition at line 351 of file BagOStuff.php.

References $db, $res, $result, and getDB().

SqlBagOStuff::serialize ( &$  data  )  [protected]

Serialize an object and, if possible, compress the representation.

On typical message and page data, this can provide a 3X decrease in storage requirements.

Parameters:
$data mixed
Returns:
string

Definition at line 416 of file BagOStuff.php.

SqlBagOStuff::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 274 of file BagOStuff.php.

References $db, getDB(), getMaxDateTime(), and handleWriteError().

SqlBagOStuff::unserialize ( serial  )  [protected]

Unserialize and, if necessary, decompress an object.

Parameters:
$serial string
Returns:
mixed

Definition at line 430 of file BagOStuff.php.

Referenced by get(), and incr().


Member Data Documentation

SqlBagOStuff::$db

Definition at line 221 of file BagOStuff.php.

Referenced by delete(), deleteAll(), expireAll(), get(), handleWriteError(), incr(), keys(), and set().

SqlBagOStuff::$lastExpireAll = 0

Definition at line 222 of file BagOStuff.php.

SqlBagOStuff::$lb

Definition at line 221 of file BagOStuff.php.


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

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