Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage Class Reference

Handles storage / retrieval of data from message change files. More...

Static Public Member Functions

static writeChanges (array $changes, string $file)
 Writes change array as a serialized file.
 
static isValidCdbName (string $fileName)
 Validate a file name.
 
static getCdbPath (string $fileName)
 Get a full path to file in a known location.
 
static getGroupChanges (string $cdbPath, string $groupId)
 
static writeGroupChanges (MessageSourceChange $changes, string $groupId, string $cdbPath)
 Writes changes for a group.
 
static getLastModifiedTime (string $cdbPath)
 Gets the last modified time for the CDB file.
 
static isModifiedSince (string $cdbPath, int $unixTimestamp)
 Checks if the CDB file has been modified since the time given.
 

Public Attributes

const DEFAULT_NAME = 'default'
 

Detailed Description

Handles storage / retrieval of data from message change files.

Author
Niklas Laxström @license GPL-2.0-or-later

Definition at line 17 of file MessageChangeStorage.php.

Member Function Documentation

◆ getCdbPath()

static MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::getCdbPath ( string $fileName)
static

Get a full path to file in a known location.

Definition at line 44 of file MessageChangeStorage.php.

◆ getGroupChanges()

static MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::getGroupChanges ( string $cdbPath,
string $groupId )
static

Definition at line 48 of file MessageChangeStorage.php.

◆ getLastModifiedTime()

static MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::getLastModifiedTime ( string $cdbPath)
static

Gets the last modified time for the CDB file.

Returns
int|null time of last modification (Unix timestamp)

Definition at line 107 of file MessageChangeStorage.php.

◆ isModifiedSince()

static MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::isModifiedSince ( string $cdbPath,
int $unixTimestamp )
static

Checks if the CDB file has been modified since the time given.

Definition at line 119 of file MessageChangeStorage.php.

◆ isValidCdbName()

static MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::isValidCdbName ( string $fileName)
static

Validate a file name.

Definition at line 39 of file MessageChangeStorage.php.

◆ writeChanges()

static MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::writeChanges ( array $changes,
string $file )
static

Writes change array as a serialized file.

Parameters
MessageSourceChange[]$changesArray of changes as returned by processGroup indexed by message group id.
string$fileWhich file to use.

Definition at line 26 of file MessageChangeStorage.php.

◆ writeGroupChanges()

static MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::writeGroupChanges ( MessageSourceChange $changes,
string $groupId,
string $cdbPath )
static

Writes changes for a group.

Has to read the changes first from the file and then re-write them to the file.

Definition at line 70 of file MessageChangeStorage.php.

Member Data Documentation

◆ DEFAULT_NAME

const MediaWiki\Extension\Translate\Synchronization\MessageChangeStorage::DEFAULT_NAME = 'default'

Definition at line 18 of file MessageChangeStorage.php.


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