MediaWiki
REL1_22
|
Maintenance script that syncs one file backend to another based on the journal of later. More...
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. |
Maintenance script that syncs one file backend to another based on the journal of later.
Definition at line 32 of file syncFileBackend.php.
Reimplemented from Maintenance.
Definition at line 33 of file syncFileBackend.php.
References Maintenance\addOption(), and Maintenance\setBatchSize().
Reimplemented from Maintenance.
Definition at line 48 of file syncFileBackend.php.
References $time, Maintenance\error(), Maintenance\getOption(), Maintenance\hasOption(), Maintenance\isQuiet(), Maintenance\output(), print, FileBackendGroup\singleton(), syncBackends(), and wfWikiID().
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.
$paths | Array|string List of paths or single string path |
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).
$src | FileBackend |
$dst | FileBackend |
$start | integer Starting journal position |
$end | integer Starting journal position |
$callback | Closure Callback to update any position file |
Definition at line 151 of file syncFileBackend.php.
References $limit, array(), as, Maintenance\error(), FileBackend\getJournal(), Maintenance\output(), syncFileBatch(), and true.
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 206 of file syncFileBackend.php.
References array(), as, 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().