MediaWiki
master
|
Proxy backend that mirrors writes to several internal backends. More...
Public Member Functions | |
__construct (array $config) | |
Construct a proxy backend that consists of several internal backends. | |
accessibilityCheck (array $paths) | |
Check that a set of file paths are usable across all internal backends. | |
clearCache (array $paths=null) | |
concatenate (array $params) | |
consistencyCheck (array $paths) | |
Check that a set of files are consistent across all internal backends. | |
directoryExists (array $params) | |
fileExists (array $params) | |
getDirectoryList (array $params) | |
getFileContentsMulti (array $params) | |
getFileHttpUrl (array $params) | |
getFileList (array $params) | |
getFileProps (array $params) | |
getFileSha1Base36 (array $params) | |
getFileSize (array $params) | |
getFileStat (array $params) | |
getFileTimestamp (array $params) | |
getLocalCopyMulti (array $params) | |
getLocalReferenceMulti (array $params) | |
getScopedLocksForOps (array $ops, Status $status) | |
resyncFiles (array $paths) | |
Check that a set of files are consistent across all internal backends and re-synchronize those files againt the "multi master" if needed. | |
streamFile (array $params) | |
Public Attributes | |
const | CHECK_SHA1 = 4 |
const | CHECK_SIZE = 1 |
const | CHECK_TIME = 2 |
Protected Member Functions | |
doClean (array $params) | |
doOperationsInternal (array $ops, array $opts) | |
doPrepare (array $params) | |
doPublish (array $params) | |
doQuickOperationsInternal (array $ops) | |
doSecure (array $params) | |
fileStoragePathsForOps (array $ops) | |
Get a list of file storage paths to read or write for a list of operations. | |
replicateContainerDirChanges ($path) | |
substOpBatchPaths (array $ops, FileBackendStore $backend) | |
Substitute the backend name in storage path parameters for a set of operations with that of a given internal backend. | |
substOpPaths (array $ops, FileBackendStore $backend) | |
Same as substOpBatchPaths() but for a single operation. | |
substPaths ($paths, FileBackendStore $backend) | |
Substitute the backend of storage paths with an internal backend's name. | |
unsubstPaths ($paths) | |
Substitute the backend of internal storage paths with the proxy backend's name. | |
Protected Attributes | |
$autoResync = false | |
Array | $backends = array() |
Prioritized list of FileBackendStore objects *. | |
$masterIndex = -1 | |
Array | $noPushDirConts = array() |
* | |
$noPushQuickOps = false | |
$syncChecks = 0 |
Proxy backend that mirrors writes to several internal backends.
This class defines a multi-write backend. Multiple backends can be registered to this proxy backend and it will act as a single backend. Use this when all access to those backends is through this proxy backend. At least one of the backends must be declared the "master" backend.
Only use this class when transitioning from one storage system to another.
Read operations are only done on the 'master' backend for consistency. Write operations are performed on all backends, in the order defined. If an operation fails on one backend it will be rolled back from the others.
Definition at line 42 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::__construct | ( | array $ | config | ) |
Construct a proxy backend that consists of several internal backends.
Locking, journaling, and read-only checks are handled by the proxy backend.
Additional $config params include:
$config | Array |
MWException |
Reimplemented from FileBackend.
Definition at line 82 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::accessibilityCheck | ( | array $ | paths | ) |
Check that a set of file paths are usable across all internal backends.
$paths | Array List of storage paths |
Definition at line 274 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::clearCache | ( | array $ | paths = null | ) |
Reimplemented from FileBackend.
Definition at line 694 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::concatenate | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 528 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::consistencyCheck | ( | array $ | paths | ) |
Check that a set of files are consistent across all internal backends.
$paths | Array List of storage paths |
Definition at line 208 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::directoryExists | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 666 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::doClean | ( | array $ | params | ) | [protected] |
$params | array |
Reimplemented from FileBackend.
Definition at line 511 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::doOperationsInternal | ( | array $ | ops, |
array $ | opts | ||
) | [final, protected] |
Reimplemented from FileBackend.
Definition at line 136 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::doPrepare | ( | array $ | params | ) | [protected] |
Reimplemented from FileBackend.
Definition at line 460 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::doPublish | ( | array $ | params | ) | [protected] |
$params | array |
Reimplemented from FileBackend.
Definition at line 494 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::doQuickOperationsInternal | ( | array $ | ops | ) | [protected] |
Reimplemented from FileBackend.
Definition at line 423 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::doSecure | ( | array $ | params | ) | [protected] |
$params | array |
Reimplemented from FileBackend.
Definition at line 477 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::fileExists | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 539 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::fileStoragePathsForOps | ( | array $ | ops | ) | [protected] |
Get a list of file storage paths to read or write for a list of operations.
$ops | Array Same format as doOperations() |
Definition at line 340 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getDirectoryList | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 676 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileContentsMulti | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 579 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileHttpUrl | ( | array $ | params | ) |
Reimplemented from FileBackend.
Definition at line 656 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileList | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 686 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileProps | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 605 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileSha1Base36 | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 595 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileSize | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 559 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileStat | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 569 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getFileTimestamp | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 549 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getLocalCopyMulti | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 641 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getLocalReferenceMulti | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 625 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::getScopedLocksForOps | ( | array $ | ops, |
Status $ | status | ||
) |
Reimplemented from FileBackend.
Definition at line 704 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::replicateContainerDirChanges | ( | $ | path | ) | [protected] |
$path | string Storage path |
Definition at line 451 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::resyncFiles | ( | array $ | paths | ) |
Check that a set of files are consistent across all internal backends and re-synchronize those files againt the "multi master" if needed.
$paths | Array List of storage paths |
Definition at line 299 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::streamFile | ( | array $ | params | ) |
$params | array |
Reimplemented from FileBackend.
Definition at line 615 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::substOpBatchPaths | ( | array $ | ops, |
FileBackendStore $ | backend | ||
) | [protected] |
Substitute the backend name in storage path parameters for a set of operations with that of a given internal backend.
$ops | Array List of file operation arrays |
$backend | FileBackendStore |
Definition at line 364 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::substOpPaths | ( | array $ | ops, |
FileBackendStore $ | backend | ||
) | [protected] |
Same as substOpBatchPaths() but for a single operation.
$ops | array File operation array |
$backend | FileBackendStore |
Definition at line 385 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::substPaths | ( | $ | paths, |
FileBackendStore $ | backend | ||
) | [protected] |
Substitute the backend of storage paths with an internal backend's name.
$paths | Array|string List of paths or single string path |
$backend | FileBackendStore |
Definition at line 397 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::unsubstPaths | ( | $ | paths | ) | [protected] |
Substitute the backend of internal storage paths with the proxy backend's name.
$paths | Array|string List of paths or single string path |
Definition at line 411 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::$autoResync = false [protected] |
Definition at line 46 of file FileBackendMultiWrite.php.
Array FileBackendMultiWrite::$backends = array() [protected] |
Prioritized list of FileBackendStore objects *.
Definition at line 43 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::$masterIndex = -1 [protected] |
Definition at line 44 of file FileBackendMultiWrite.php.
Array FileBackendMultiWrite::$noPushDirConts = array() [protected] |
*
Definition at line 48 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::$noPushQuickOps = false [protected] |
Definition at line 49 of file FileBackendMultiWrite.php.
FileBackendMultiWrite::$syncChecks = 0 [protected] |
Definition at line 45 of file FileBackendMultiWrite.php.
const FileBackendMultiWrite::CHECK_SHA1 = 4 |
Definition at line 54 of file FileBackendMultiWrite.php.
const FileBackendMultiWrite::CHECK_SIZE = 1 |
Definition at line 52 of file FileBackendMultiWrite.php.
const FileBackendMultiWrite::CHECK_TIME = 2 |
Definition at line 53 of file FileBackendMultiWrite.php.