MediaWiki
REL1_20
|
Maintenance script that syncs one file backend to another based on the journal of later. More...
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. |
Maintenance script that syncs one file backend to another based on the journal of later.
Definition at line 32 of file syncFileBackend.php.
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().
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.
$paths | Array|string List of paths or single string path |
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).
$src | FileBackend |
$dst | FileBackend |
$start | integer Starting journal position |
$end | integer Starting journal position |
Definition at line 107 of file syncFileBackend.php.
References $limit, Maintenance\error(), FileBackend\getJournal(), Maintenance\output(), and syncFileBatch().
Referenced by execute().
SyncFileBackend::syncFileBatch | ( | array $ | paths, |
FileBackend $ | src, | ||
FileBackend $ | dst | ||
) | [protected] |
Sync particular files of backend $src to the corresponding $dst backend files.
$paths | Array |
$src | FileBackend |
$dst | FileBackend |
Definition at line 159 of file syncFileBackend.php.
References FileBackend\doQuickOperations(), Maintenance\error(), FileBackend\fileExists(), filesAreSame(), FileBackend\getLocalReference(), FileBackend\getName(), Maintenance\getOption(), FileBackend\getScopedFileLocks(), LockManager\LOCK_EX, LockManager\LOCK_UW, Status\newGood(), Maintenance\output(), FileBackend\prepare(), and replaceNamePaths().
Referenced by syncBackends().