Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:$wgLocalFileRepo

From mediawiki.org
Translate this page
Languages:
Files and file uploads: $wgLocalFileRepo
A single repository structure for the local repository.
Introduced in version:1.11.0 (r22580)
Removed in version:Still in use
Allowed values:(array)
Default value:see below
Other settings:Alphabetical |By function

Details

[edit]

This config is for customising the local (primary) file repo that MediaWiki uses.Most users will not want to customise this or will customise this indirectly via other variables such as$wgUploadDirectory.

More complex setups may requiring customising this variable.For example, if you want to use a custom file backend, in order to replicate file storage amongst multiple data centers.

Properties required for all repos

[edit]
class
The class name for the repository. May come from the core or an extension. The core repository classes are FileRepo, LocalRepo, ForeignDBRepo. (FSRepo is also supported for backwards compatibility.)
name
Should be set to'local'.
backend
A file backend name (see$wgFileBackends). For $wgLocalFileRepo and$wgForeignFileRepos, a name is automatically generated inSetup.php if not defined.

General parameters for LocalRepo class

[edit]
NameDescriptionDefault
zonesConfig of where to store files (different zones like public vs deleted). An array of zone descriptions containing: container, url, directory, urlsByExt. Some other config options may override this one in specific cases
urlBase public URL
hashLevelsThe number of directory levels for hash-based division of files (see$wgHashedUploadDirectory for info)
deletedHashLevels'hashLevels' override for the "deleted" zone.
thumbScriptUrlThe URL for thumb.php (optional, not recommended)
transformVia404Whether to skip media file transformation on parse and rely on a 404 handler instead.
thumbProxyUrlURL of where to proxy thumb.php requests to. This is also used internally for remote thumbnailing of upload stash files. Example: http://127.0.0.1:8888/wiki/dev/thumb/
thumbProxySecretOptional value of theX-Swift-Secret header to use in requests to thumbProxyUrl
disableLocalTransformDo not resize images on local machine, but instead use some other system to do so
initialCapitalEquivalent to$wgCapitalLinks, determines whether filenames implicitly start with a capital letter. The current implementation may give incorrect description page links when the local$wgCapitalLinks and initialCapital are mismatched.
pathDisclosureProtectionMay be 'paranoid' to remove all parameters from error messages, 'none' to leave the paths in unchanged, or 'simple' to replace paths with placeholders. Default for LocalRepo is 'simple'.
fileModeUsed by FileBackend to set the unix permissions on created files.0644
directoryUsed by FileBackend to determine upload directory
thumbDirThe base thumbnail directory (if not overridden by zone directive)
thumbUrlThe base thumbnail URL (if not overridden by zone directive)
isPrivateIs this repo private (E.g. its a private repo). Steps are taken to prevent direct access, but may not be sufficient and you should still make sure the files aren't somewhere served by webserver.
useJsonMetadataStore serialised metadata as JSON instead of php-serialised format.false (1.38)/
true (1.39+)
useSplitMetadataStore large chunks of FileMetadata inexternal storage. Some files have their entire text layer as metadata, which can cause memory issues if stored directly on the file.false
splitMetadataThresholdThreshold above which metadata items should be split into external storage.1000
updateCompatibleMetadataAutomatically regenerate file metadata if it is detected metadata is out of date.false
reserializeMetadataAutomatically change metadata format (E.g. to JSON) or split it to separate storage, if it is detected as needed.false


Default value

[edit]

This code, in Setup.php, generates a default value for $wgLocalFileRepo based on the values of other configuration settings:

if ( !$wgLocalFileRepo ) {$wgLocalFileRepo = ['class' => LocalRepo::class,'name' =>'local','directory' =>$wgUploadDirectory,'scriptDirUrl' =>$wgScriptPath,'url' =>$wgUploadBaseUrl ?$wgUploadBaseUrl .$wgUploadPath :$wgUploadPath,'hashLevels' =>$wgHashedUploadDirectory ? 2 : 0,'thumbScriptUrl' =>$wgThumbnailScriptPath,'transformVia404' => !$wgGenerateThumbnailOnParse,'deletedDir' =>$wgDeletedDirectory,'deletedHashLevels' =>$wgHashedUploadDirectory ? 3 : 0];}

See also

[edit]
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:$wgLocalFileRepo&oldid=6246750"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp