MediaWiki  REL1_22
SyncFileBackend Class Reference

Maintenance script that syncs one file backend to another based on the journal of later. More...

Inheritance diagram for SyncFileBackend:
Collaboration diagram for SyncFileBackend:

List of all members.

Public Member Functions

 __construct ()
 execute ()

Protected Member Functions

 filesAreSame (FileBackend $src, FileBackend $dst, $sPath, $dPath)
 replaceNamePaths ($paths, FileBackend $backend)
 Substitute the backend name of storage paths with that of a given one.
 syncBackends (FileBackend $src, FileBackend $dst, $start, $end, Closure $callback)
 Sync $dst backend to $src backend based on the $src logs given after $start.
 syncFileBatch (array $paths, FileBackend $src, FileBackend $dst)
 Sync particular files of backend $src to the corresponding $dst backend files.

Detailed Description

Maintenance script that syncs one file backend to another based on the journal of later.

Definition at line 32 of file syncFileBackend.php.


Constructor & Destructor Documentation

Reimplemented from Maintenance.

Definition at line 33 of file syncFileBackend.php.

References Maintenance\addOption(), and Maintenance\setBatchSize().


Member Function Documentation

SyncFileBackend::filesAreSame ( FileBackend src,
FileBackend dst,
sPath,
dPath 
) [protected]

Definition at line 287 of file syncFileBackend.php.

References array(), FileBackend\getFileSha1Base36(), and FileBackend\getFileSize().

Referenced by syncFileBatch().

SyncFileBackend::replaceNamePaths ( paths,
FileBackend backend 
) [protected]

Substitute the backend name of storage paths with that of a given one.

Parameters:
$pathsArray|string List of paths or single string path
Returns:
Array|string

Definition at line 279 of file syncFileBackend.php.

References StringUtils\escapeRegexReplacement(), and FileBackend\getName().

Referenced by syncFileBatch().

SyncFileBackend::syncBackends ( FileBackend src,
FileBackend dst,
start,
end,
Closure $  callback 
) [protected]

Sync $dst backend to $src backend based on the $src logs given after $start.

Returns the journal entry ID this advanced to and handled (inclusive).

Parameters:
$srcFileBackend
$dstFileBackend
$startinteger Starting journal position
$endinteger Starting journal position
$callbackClosure Callback to update any position file
Returns:
integer|false Journal entry ID or false if there are none

Definition at line 151 of file syncFileBackend.php.

References $limit, array(), as, Maintenance\error(), FileBackend\getJournal(), Maintenance\output(), syncFileBatch(), and true.

Referenced by execute().


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