MediaWiki REL1_35
DBFileJournal Class Reference

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

Inheritance diagram for DBFileJournal:
Collaboration diagram for DBFileJournal:

Public Member Functions

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

Protected Member Functions

 doGetChangeEntries ( $start, $limit)
 
 doGetCurrentPosition ()
 
 doGetPositionAtTime ( $time)
 
 doLogChangeBatch (array $entries, $batchId)
 
 doPurgeOldLogs ()
 
 getMasterDB ()
 Get a master connection to the logging DB.
 

Protected Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from FileJournal
static factory (array $config, $backend)
 Create an appropriate FileJournal object from config.
 

Detailed Description

Version of FileJournal that logs to a DB table.

Since
1.20

Definition at line 33 of file DBFileJournal.php.

Constructor & Destructor Documentation

◆ __construct()

DBFileJournal::__construct ( array  $config)

Construct a new instance from configuration.

Parameters
array$configIncludes:
  • domain: database domain ID of the wiki

Reimplemented from FileJournal.

Definition at line 45 of file DBFileJournal.php.

Member Function Documentation

◆ doGetChangeEntries()

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

Reimplemented from FileJournal.

Definition at line 135 of file DBFileJournal.php.

References $dbw, $res, Wikimedia\Rdbms\IDatabase\addQuotes(), getMasterDB(), and Wikimedia\Rdbms\IDatabase\select().

◆ doGetCurrentPosition()

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

Reimplemented from FileJournal.

Definition at line 103 of file DBFileJournal.php.

References $dbw, getMasterDB(), and Wikimedia\Rdbms\IDatabase\selectField().

◆ doGetPositionAtTime()

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

Reimplemented from FileJournal.

Definition at line 117 of file DBFileJournal.php.

References $dbw, Wikimedia\Rdbms\IDatabase\addQuotes(), getMasterDB(), Wikimedia\Rdbms\IDatabase\selectField(), and Wikimedia\Rdbms\IDatabase\timestamp().

◆ doLogChangeBatch()

DBFileJournal::doLogChangeBatch ( array  $entries,
  $batchId 
)
protected
See also
FileJournal::logChangeBatch()
Parameters
array[]$entries
string$batchId
Returns
StatusValue

Reimplemented from FileJournal.

Definition at line 57 of file DBFileJournal.php.

References FileJournal\$backend, $dbw, getMasterDB(), Wikimedia\Rdbms\IDatabase\insert(), FileJournal\purgeOldLogs(), and Wikimedia\Rdbms\IDatabase\timestamp().

◆ doPurgeOldLogs()

DBFileJournal::doPurgeOldLogs ( )
protected

◆ getMasterDB()

DBFileJournal::getMasterDB ( )
protected

Get a master connection to the logging DB.

Returns
IDatabase
Exceptions
DBError

Definition at line 187 of file DBFileJournal.php.

References $dbw, DB_MASTER, and DBO_TRX.

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

Member Data Documentation

◆ $dbw

IDatabase DBFileJournal::$dbw
protected

◆ $domain

string DBFileJournal::$domain
protected

Definition at line 37 of file DBFileJournal.php.


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