MediaWiki  1.27.2
DBFileJournal Class Reference

Version of FileJournal that logs to a DB table. More...

Inheritance diagram for DBFileJournal:
Collaboration diagram for DBFileJournal:

Protected Member Functions

 __construct (array $config)
 Construct a new instance from configuration. More...
 
 doGetChangeEntries ($start, $limit)
 
 doGetCurrentPosition ()
 
 doGetPositionAtTime ($time)
 
 doLogChangeBatch (array $entries, $batchId)
 
 doPurgeOldLogs ()
 
 getMasterDB ()
 Get a master connection to the logging DB. More...
 
- Protected Member Functions inherited from FileJournal
 __construct (array $config)
 Construct a new instance from configuration. More...
 
 doGetChangeEntries ($start, $limit)
 
 doGetCurrentPosition ()
 
 doGetPositionAtTime ($time)
 
 doLogChangeBatch (array $entries, $batchId)
 
 doPurgeOldLogs ()
 

Protected Attributes

IDatabase $dbw
 
 $wiki = false
 
- Protected Attributes inherited from FileJournal
string $backend
 
int $ttlDays
 

Additional Inherited Members

- Public Member Functions inherited from FileJournal
 getChangeEntries ($start=null, $limit=0, &$next=null)
 Get an array of file change log entries. More...
 
 getCurrentPosition ()
 Get the position ID of the latest journal entry. More...
 
 getPositionAtTime ($time)
 Get the position ID of the latest journal entry at some point in time. More...
 
 getTimestampedUUID ()
 Get a statistically unique ID string. More...
 
 logChangeBatch (array $entries, $batchId)
 Log changes made by a batch file operation. More...
 
 purgeOldLogs ()
 Purge any old log entries. More...
 
- Static Public Member Functions inherited from FileJournal
static factory (array $config, $backend)
 Create an appropriate FileJournal object from config. More...
 

Detailed Description

Version of FileJournal that logs to a DB table.

Since
1.20

Definition at line 29 of file DBFileJournal.php.

Constructor & Destructor Documentation

DBFileJournal::__construct ( array  $config)
protected

Construct a new instance from configuration.

Parameters
array$configIncludes: 'wiki' : wiki name to use for LoadBalancer

Definition at line 41 of file DBFileJournal.php.

References wiki.

Member Function Documentation

DBFileJournal::doGetChangeEntries (   $start,
  $limit 
)
protected
See also
FileJournal::doGetChangeEntries()
Parameters
int$start
int$limit
Returns
array

Definition at line 128 of file DBFileJournal.php.

References $key, $limit, $res, $value, IDatabase\addQuotes(), array(), as, getMasterDB(), and IDatabase\select().

DBFileJournal::doGetCurrentPosition ( )
protected
See also
FileJournal::doGetCurrentPosition()
Returns
bool|mixed The value from the field, or false on failure.

Definition at line 96 of file DBFileJournal.php.

References getMasterDB(), and IDatabase\selectField().

DBFileJournal::doGetPositionAtTime (   $time)
protected
See also
FileJournal::doGetPositionAtTime()
Parameters
int | string$timeTimestamp
Returns
bool|mixed The value from the field, or false on failure.

Definition at line 110 of file DBFileJournal.php.

References $time, IDatabase\addQuotes(), getMasterDB(), IDatabase\selectField(), and IDatabase\timestamp().

DBFileJournal::doLogChangeBatch ( array  $entries,
  $batchId 
)
protected
DBFileJournal::doPurgeOldLogs ( )
protected
DBFileJournal::getMasterDB ( )
protected

Get a master connection to the logging DB.

Returns
IDatabase
Exceptions
DBError

Definition at line 180 of file DBFileJournal.php.

References $dbw, DB_MASTER, DBO_TRX, wfGetLBFactory(), and wiki.

Referenced by doGetChangeEntries(), doGetCurrentPosition(), doGetPositionAtTime(), doLogChangeBatch(), and doPurgeOldLogs().

Member Data Documentation

IDatabase DBFileJournal::$dbw
protected

Definition at line 31 of file DBFileJournal.php.

Referenced by getMasterDB().

DBFileJournal::$wiki = false
protected

Definition at line 33 of file DBFileJournal.php.


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