29use Wikimedia\ObjectFactory;
30use Wikimedia\Timestamp\ConvertibleTimestamp;
53 $this->ttlDays = $config[
'ttlDays'] ??
false;
65 $jrn = ObjectFactory::getObjectFromSpec(
67 [
'specIsArg' =>
true,
'assertClass' => __CLASS__ ]
81 for ( $i = 0; $i < 5; $i++ ) {
82 $s .= mt_rand( 0, 2147483647 );
84 $s = Wikimedia\base_convert( sha1(
$s ), 16, 36, 31 );
86 $timestamp = ConvertibleTimestamp::convert( TS_MW, time() );
88 return substr(
Wikimedia\base_convert( $timestamp, 10, 36, 9 ) .
$s, 0, 31 );
103 if ( $entries === [] ) {
104 return StatusValue::newGood();
170 if ( $limit && count( $entries ) > $limit ) {
171 $last = array_pop( $entries );
Class for handling file operation journaling.
logChangeBatch(array $entries, $batchId)
Log changes made by a batch file operation.
__construct(array $config)
Construct a new instance from configuration.
getPositionAtTime( $time)
Get the position ID of the latest journal entry at some point in time.
getCurrentPosition()
Get the position ID of the latest journal entry.
purgeOldLogs()
Purge any old log entries.
doGetChangeEntries( $start, $limit)
getTimestampedUUID()
Get a statistically unique ID string.
getChangeEntries( $start=null, $limit=0, &$next=null)
Get an array of file change log entries.
static factory(array $config, $backend)
Create an appropriate FileJournal object from config.
doLogChangeBatch(array $entries, $batchId)
doGetPositionAtTime( $time)