|
MediaWiki
REL1_20
|
Class for handling file operation journaling. More...

Public Member Functions | |
| getChangeEntries ($start=null, $limit=0, &$next=null) | |
| Get an array of file change log entries. | |
| 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. | |
Static Public Member Functions | |
| static | factory (array $config, $backend) |
| Create an appropriate FileJournal object from config. | |
Protected Member Functions | |
| __construct (array $config) | |
| Construct a new instance from configuration. | |
| doGetChangeEntries ($start, $limit) | |
| doLogChangeBatch (array $entries, $batchId) | |
| doPurgeOldLogs () | |
Protected Attributes | |
| $backend | |
| $ttlDays | |
Class for handling file operation journaling.
Subclasses should avoid throwing exceptions at all costs.
Definition at line 38 of file FileJournal.php.
| FileJournal::__construct | ( | array $ | config | ) | [protected] |
Construct a new instance from configuration.
$config includes: 'ttlDays' : days to keep log entries around (false means "forever")
| $config | Array |
Reimplemented in DBFileJournal.
Definition at line 49 of file FileJournal.php.
| FileJournal::doGetChangeEntries | ( | $ | start, |
| $ | limit | ||
| ) | [abstract, protected] |
Reimplemented in NullFileJournal, and DBFileJournal.
Referenced by getChangeEntries().
| FileJournal::doLogChangeBatch | ( | array $ | entries, |
| $ | batchId | ||
| ) | [abstract, protected] |
| $entries | Array List of file operations (each an array of parameters) |
| $batchId | string UUID string that identifies the operation batch |
Reimplemented in NullFileJournal, and DBFileJournal.
Referenced by logChangeBatch().
| FileJournal::doPurgeOldLogs | ( | ) | [abstract, protected] |
Reimplemented in NullFileJournal, and DBFileJournal.
Referenced by purgeOldLogs().
| static FileJournal::factory | ( | array $ | config, |
| $ | backend | ||
| ) | [static, final] |
Create an appropriate FileJournal object from config.
| $config | Array |
| $backend | string A registered file backend name |
| MWException |
Definition at line 61 of file FileJournal.php.
References $backend.
| FileJournal::getChangeEntries | ( | $ | start = null, |
| $ | limit = 0, |
||
| &$ | next = null |
||
| ) | [final] |
Get an array of file change log entries.
A starting change ID and/or limit can be specified.
The result as a list of associative arrays, each having: id : unique, monotonic, ID for this change batch_uuid : UUID for an operation batch backend : the backend name op : primitive operation (create,update,delete,null) path : affected storage path new_sha1 : base 36 sha1 of the new file had the operation succeeded timestamp : TS_MW timestamp of the batch change
Also, $next is updated to the ID of the next entry.
| $start | integer Starting change ID or null |
| $limit | integer Maximum number of items to return |
| &$next | string |
Definition at line 133 of file FileJournal.php.
References $limit, and doGetChangeEntries().
| FileJournal::getTimestampedUUID | ( | ) | [final] |
Get a statistically unique ID string.
Definition at line 76 of file FileJournal.php.
References $s, wfBaseConvert(), and wfTimestamp().
Referenced by FileOpBatch\attempt().
| FileJournal::logChangeBatch | ( | array $ | entries, |
| $ | batchId | ||
| ) | [final] |
Log changes made by a batch file operation.
$entries is an array of log entries, each of which contains: op : Basic operation name (create, store, copy, delete) path : The storage path of the file newSha1 : The final base 36 SHA-1 of the file Note that 'false' should be used as the SHA-1 for non-existing files.
| $entries | Array List of file operations (each an array of parameters) |
| $batchId | string UUID string that identifies the operation batch |
Definition at line 97 of file FileJournal.php.
References doLogChangeBatch(), and Status\newGood().
Referenced by FileOpBatch\attempt().
| FileJournal::purgeOldLogs | ( | ) | [final] |
Purge any old log entries.
Definition at line 155 of file FileJournal.php.
References doPurgeOldLogs().
FileJournal::$backend [protected] |
Definition at line 39 of file FileJournal.php.
Referenced by factory().
FileJournal::$ttlDays [protected] |
Definition at line 40 of file FileJournal.php.