MediaWiki  master
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. More...
 
- 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...
 

Protected Member Functions

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

Protected Attributes

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. More...
 

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 43 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 133 of file DBFileJournal.php.

References $res, and getPrimaryDB().

◆ doGetCurrentPosition()

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

Reimplemented from FileJournal.

Definition at line 101 of file DBFileJournal.php.

References getPrimaryDB().

◆ doGetPositionAtTime()

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

Reimplemented from FileJournal.

Definition at line 115 of file DBFileJournal.php.

References getPrimaryDB().

◆ doLogChangeBatch()

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

Reimplemented from FileJournal.

Definition at line 55 of file DBFileJournal.php.

References FileJournal\$backend, getPrimaryDB(), StatusValue\newGood(), and FileJournal\purgeOldLogs().

◆ doPurgeOldLogs()

DBFileJournal::doPurgeOldLogs ( )
protected
See also
FileJournal::purgeOldLogs()
Returns
StatusValue
Exceptions
DBError

Reimplemented from FileJournal.

Definition at line 162 of file DBFileJournal.php.

References getPrimaryDB(), and StatusValue\newGood().

◆ getMasterDB()

DBFileJournal::getMasterDB ( )
protected

Get a primary connection to the logging DB.

Deprecated:
since 1.37
Returns
IDatabase
Exceptions
DBError

Definition at line 198 of file DBFileJournal.php.

References getPrimaryDB(), and wfDeprecated().

◆ getPrimaryDB()

DBFileJournal::getPrimaryDB ( )
protected

Get a primary connection to the logging DB.

Returns
IDatabase
Exceptions
DBError

Definition at line 185 of file DBFileJournal.php.

References DB_PRIMARY.

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

Member Data Documentation

◆ $domain

string DBFileJournal::$domain
protected

Definition at line 35 of file DBFileJournal.php.


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