/**
* @see FileBackendStore::__construct()
* Additional $config params include:
- * basePath : File system directory that holds containers.
- * containerPaths : Map of container names to custom file system directories.
- * This should only be used for backwards-compatibility.
- * fileMode : Octal UNIX file permissions to use on files stored.
+ * - basePath : File system directory that holds containers.
+ * - containerPaths : Map of container names to custom file system directories.
+ * This should only be used for backwards-compatibility.
+ * - fileMode : Octal UNIX file permissions to use on files stored.
*/
public function __construct( array $config ) {
parent::__construct( $config );
* will reflect each operation attempted.
*
* The status will be "OK" unless:
- * a) unexpected operation errors occurred (network partitions, disk full...)
- * b) significant operation errors occured and 'force' was not set
+ * - a) unexpected operation errors occurred (network partitions, disk full...)
+ * - b) significant operation errors occured and 'force' was not set
*
* @param $ops Array List of operations to execute in order
* @param $opts Array Batch operation options
* Locking, journaling, and read-only checks are handled by the proxy backend.
*
* Additional $config params include:
- * 'backends' : Array of backend config and multi-backend settings.
- * Each value is the config used in the constructor of a
- * FileBackendStore class, but with these additional settings:
- * 'class' : The name of the backend class
- * 'isMultiMaster' : This must be set for one backend.
- * 'template: : If given a backend name, this will use
- * the config of that backend as a template.
- * Values specified here take precedence.
- * 'syncChecks' : Integer bitfield of internal backend sync checks to perform.
- * Possible bits include the FileBackendMultiWrite::CHECK_* constants.
- * There are constants for SIZE, TIME, and SHA1.
- * The checks are done before allowing any file operations.
+ * - backends : Array of backend config and multi-backend settings.
+ * Each value is the config used in the constructor of a
+ * FileBackendStore class, but with these additional settings:
+ * - class : The name of the backend class
+ * - isMultiMaster : This must be set for one backend.
+ * - template: : If given a backend name, this will use
+ * the config of that backend as a template.
+ * Values specified here take precedence.
+ * - syncChecks : Integer bitfield of internal backend sync checks to perform.
+ * Possible bits include the FileBackendMultiWrite::CHECK_* constants.
+ * There are constants for SIZE, TIME, and SHA1.
+ * The checks are done before allowing any file operations.
* @param $config Array
* @throws MWException
*/
foreach ( $config['backends'] as $index => $config ) {
if ( isset( $config['template'] ) ) {
// Config is just a modified version of a registered backend's.
- // This should only be used when that config is used only be this backend.
+ // This should only be used when that config is used only by this backend.
$config = $config + FileBackendGroup::singleton()->config( $config['template'] );
}
$name = $config['name'];
* Do not call this function from places outside FileBackend and FileOp.
*
* $params include:
- * content : the raw file contents
- * dst : destination storage path
- * overwrite : overwrite any file that exists at the destination
- * async : Status will be returned immediately if supported.
+ * - content : the raw file contents
+ * - dst : destination storage path
+ * - overwrite : overwrite any file that exists at the destination
+ * - async : Status will be returned immediately if supported.
* If the status is OK, then its value field will be
* set to a FileBackendStoreOpHandle object.
*
* Do not call this function from places outside FileBackend and FileOp.
*
* $params include:
- * src : source path on disk
- * dst : destination storage path
- * overwrite : overwrite any file that exists at the destination
- * async : Status will be returned immediately if supported.
+ * - src : source path on disk
+ * - dst : destination storage path
+ * - overwrite : overwrite any file that exists at the destination
+ * - async : Status will be returned immediately if supported.
* If the status is OK, then its value field will be
* set to a FileBackendStoreOpHandle object.
*
* Do not call this function from places outside FileBackend and FileOp.
*
* $params include:
- * src : source storage path
- * dst : destination storage path
- * overwrite : overwrite any file that exists at the destination
- * async : Status will be returned immediately if supported.
+ * - src : source storage path
+ * - dst : destination storage path
+ * - overwrite : overwrite any file that exists at the destination
+ * - async : Status will be returned immediately if supported.
* If the status is OK, then its value field will be
* set to a FileBackendStoreOpHandle object.
*
* Do not call this function from places outside FileBackend and FileOp.
*
* $params include:
- * src : source storage path
- * ignoreMissingSource : do nothing if the source file does not exist
- * async : Status will be returned immediately if supported.
+ * - src : source storage path
+ * - ignoreMissingSource : do nothing if the source file does not exist
+ * - async : Status will be returned immediately if supported.
* If the status is OK, then its value field will be
* set to a FileBackendStoreOpHandle object.
*
* Do not call this function from places outside FileBackend and FileOp.
*
* $params include:
- * src : source storage path
- * dst : destination storage path
- * overwrite : overwrite any file that exists at the destination
- * async : Status will be returned immediately if supported.
+ * - src : source storage path
+ * - dst : destination storage path
+ * - overwrite : overwrite any file that exists at the destination
+ * - async : Status will be returned immediately if supported.
* If the status is OK, then its value field will be
* set to a FileBackendStoreOpHandle object.
*
/**
* Store a file into the backend from a file on the file system.
* Parameters similar to FileBackendStore::storeInternal(), which include:
- * src : source path on file system
- * dst : destination storage path
- * overwrite : do nothing and pass if an identical file exists at destination
- * overwriteSame : override any existing file at destination
+ * - src : source path on file system
+ * - dst : destination storage path
+ * - overwrite : do nothing and pass if an identical file exists at destination
+ * - overwriteSame : override any existing file at destination
*/
class StoreFileOp extends FileOp {
/**
/**
* Create a file in the backend with the given content.
* Parameters similar to FileBackendStore::createInternal(), which include:
- * content : the raw file contents
- * dst : destination storage path
- * overwrite : do nothing and pass if an identical file exists at destination
- * overwriteSame : override any existing file at destination
+ * - content : the raw file contents
+ * - dst : destination storage path
+ * - overwrite : do nothing and pass if an identical file exists at destination
+ * - overwriteSame : override any existing file at destination
*/
class CreateFileOp extends FileOp {
protected function allowedParams() {
/**
* Copy a file from one storage path to another in the backend.
* Parameters similar to FileBackendStore::copyInternal(), which include:
- * src : source storage path
- * dst : destination storage path
- * overwrite : do nothing and pass if an identical file exists at destination
- * overwriteSame : override any existing file at destination
+ * - src : source storage path
+ * - dst : destination storage path
+ * - overwrite : do nothing and pass if an identical file exists at destination
+ * - overwriteSame : override any existing file at destination
*/
class CopyFileOp extends FileOp {
/**
/**
* Move a file from one storage path to another in the backend.
* Parameters similar to FileBackendStore::moveInternal(), which include:
- * src : source storage path
- * dst : destination storage path
- * overwrite : do nothing and pass if an identical file exists at destination
- * overwriteSame : override any existing file at destination
+ * - src : source storage path
+ * - dst : destination storage path
+ * - overwrite : do nothing and pass if an identical file exists at destination
+ * - overwriteSame : override any existing file at destination
*/
class MoveFileOp extends FileOp {
/**
/**
* Delete a file at the given storage path from the backend.
* Parameters similar to FileBackendStore::deleteInternal(), which include:
- * src : source storage path
- * ignoreMissingSource : don't return an error if the file does not exist
+ * - src : source storage path
+ * - ignoreMissingSource : don't return an error if the file does not exist
*/
class DeleteFileOp extends FileOp {
/**
* Callers are responsible for handling file locking.
*
* $opts is an array of options, including:
- * 'force' : Errors that would normally cause a rollback do not.
- * The remaining operations are still attempted if any fail.
- * 'allowStale' : Don't require the latest available data.
- * This can increase performance for non-critical writes.
- * This has no effect unless the 'force' flag is set.
- * 'nonJournaled' : Don't log this operation batch in the file journal.
- * 'concurrency' : Try to do this many operations in parallel when possible.
+ * - force : Errors that would normally cause a rollback do not.
+ * The remaining operations are still attempted if any fail.
+ * - allowStale : Don't require the latest available data.
+ * This can increase performance for non-critical writes.
+ * This has no effect unless the 'force' flag is set.
+ * - nonJournaled : Don't log this operation batch in the file journal.
+ * - concurrency : Try to do this many operations in parallel when possible.
*
* The resulting Status will be "OK" unless:
- * a) unexpected operation errors occurred (network partitions, disk full...)
- * b) significant operation errors occured and 'force' was not set
+ * - a) unexpected operation errors occurred (network partitions, disk full...)
+ * - b) significant operation errors occured and 'force' was not set
*
* @param $performOps Array List of FileOp operations
* @param $opts Array Batch operation options
/**
* @see FileBackendStore::__construct()
* Additional $config params include:
- * swiftAuthUrl : Swift authentication server URL
- * swiftUser : Swift user used by MediaWiki (account:username)
- * swiftKey : Swift authentication key for the above user
- * swiftAuthTTL : Swift authentication TTL (seconds)
- * swiftAnonUser : Swift user used for end-user requests (account:username).
- * If set, then views of public containers are assumed to go
- * through this user. If not set, then public containers are
- * accessible to unauthenticated requests via ".r:*" in the ACL.
- * swiftUseCDN : Whether a Cloud Files Content Delivery Network is set up
- * swiftCDNExpiry : How long (in seconds) to store content in the CDN.
- * If files may likely change, this should probably not exceed
- * a few days. For example, deletions may take this long to apply.
- * If object purging is enabled, however, this is not an issue.
- * swiftCDNPurgable : Whether object purge requests are allowed by the CDN.
- * shardViaHashLevels : Map of container names to sharding config with:
- * 'base' : base of hash characters, 16 or 36
- * 'levels' : the number of hash levels (and digits)
- * 'repeat' : hash subdirectories are prefixed with all the
- * parent hash directory names (e.g. "a/ab/abc")
+ * - swiftAuthUrl : Swift authentication server URL
+ * - swiftUser : Swift user used by MediaWiki (account:username)
+ * - swiftKey : Swift authentication key for the above user
+ * - swiftAuthTTL : Swift authentication TTL (seconds)
+ * - swiftAnonUser : Swift user used for end-user requests (account:username).
+ * If set, then views of public containers are assumed to go
+ * through this user. If not set, then public containers are
+ * accessible to unauthenticated requests via ".r:*" in the ACL.
+ * - swiftUseCDN : Whether a Cloud Files Content Delivery Network is set up
+ * - swiftCDNExpiry : How long (in seconds) to store content in the CDN.
+ * If files may likely change, this should probably not exceed
+ * a few days. For example, deletions may take this long to apply.
+ * If object purging is enabled, however, this is not an issue.
+ * - swiftCDNPurgable : Whether object purge requests are allowed by the CDN.
+ * - shardViaHashLevels : Map of container names to sharding config with:
+ * - base : base of hash characters, 16 or 36
+ * - levels : the number of hash levels (and digits)
+ * - repeat : hash subdirectories are prefixed with all the
+ * parent hash directory names (e.g. "a/ab/abc")
*/
public function __construct( array $config ) {
parent::__construct( $config );
*
* $readGrps is a list of the possible criteria for a request to have
* access to read a container. Each item is one of the following formats:
- * account:user - Grants access if the request is by the given user
- * .r:<regex> - Grants access if the request is from a referrer host that
- * matches the expression and the request is not for a listing.
- * Setting this to '*' effectively makes a container public.
- * .rlistings:<regex> - Grants access if the request is from a referrer host that
- * matches the expression and the request for a listing.
+ * - account:user : Grants access if the request is by the given user
+ * - .r:<regex> : Grants access if the request is from a referrer host that
+ * matches the expression and the request is not for a listing.
+ * Setting this to '*' effectively makes a container public.
+ * - .rlistings:<regex> : Grants access if the request is from a referrer host that
+ * matches the expression and the request for a listing.
+ *
* $writeGrps is a list of the possible criteria for a request to have
* access to write to a container. Each item is of the following format:
- * account:user - Grants access if the request is by the given user
+ * - account:user : Grants access if the request is by the given user
*
* @see http://swift.openstack.org/misc.html#acls
*