MediaWiki  REL1_20
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 ()
 Default constructor.
 execute ()
 Do the actual work.

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)
 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

Default constructor.

Children should call this *first* if implementing their own constructors

Reimplemented from Maintenance.

Definition at line 33 of file syncFileBackend.php.

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


Member Function Documentation

Do the actual work.

All child classes will need to implement this

Reimplemented from Maintenance.

Definition at line 45 of file syncFileBackend.php.

References Maintenance\getOption(), Maintenance\isQuiet(), Maintenance\output(), print, FileBackendGroup\singleton(), syncBackends(), and wfWikiID().

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

Definition at line 240 of file syncFileBackend.php.

References 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 232 of file syncFileBackend.php.

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

Referenced by syncFileBatch().

SyncFileBackend::syncBackends ( FileBackend src,
FileBackend dst,
start,
end 
) [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
Returns:
integer|false Journal entry ID or false if there are none

Definition at line 107 of file syncFileBackend.php.

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

Referenced by execute().


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