MediaWiki
REL1_24
|
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 294 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.
array | string | $paths | List of paths or single string path |
FileBackend | $backend |
Definition at line 286 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).
FileBackend | $src | |
FileBackend | $dst | |
int | $start | Starting journal position |
int | $end | Starting journal position |
Closure | $callback | Callback to update any position file |
Definition at line 152 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.
array | $paths | |
FileBackend | $src | |
FileBackend | $dst |
Definition at line 207 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\preloadFileStat(), FileBackend\prepare(), and replaceNamePaths().
Referenced by syncBackends().