Manual:$wgLocalFileRepo

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎日本語 • ‎polski
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]

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'.


For all core repos[edit]

url
Base public URL
hashLevels
The number of directory levels for hash-based division of files (see $wgHashedUploadDirectory for info)
thumbScriptUrl
The URL for thumb.php (optional, not recommended)
transformVia404
Whether to skip media file transformation on parse and rely on a 404 handler instead.
initialCapital
Equivalent to $wgCapitalLinksManual:$wgCapitalLinks, determines whether filenames implicitly start with a capital letter. The current implementation may give incorrect description page links when the local $wgCapitalLinksManual:$wgCapitalLinks and initialCapital are mismatched.
pathDisclosureProtection
May 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'.

Default value[edit]

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

if ( !$wgLocalFileRepo ) {
    if ( isset( $wgFileStoreManual:$wgFileStore['deleted']['hash'] ) ) {
        $deletedHashLevel = $wgFileStoreManual:$wgFileStore['deleted']['hash'];
    } else {
        $deletedHashLevel = $wgHashedUploadDirectoryManual:$wgHashedUploadDirectory ? 3 : 0;
    }
    $wgLocalFileRepo = array(
        'class' => 'LocalRepo',
        'name' => 'local',
        'directory' => $wgUploadDirectoryManual:$wgUploadDirectory,
        'scriptDirUrl' => $wgScriptPathManual:$wgScriptPath,
        'scriptExtension' => $wgScriptExtensionManual:$wgScriptExtension,
        'url' => $wgUploadBaseUrlManual:$wgUploadBaseUrl ? $wgUploadBaseUrlManual:$wgUploadBaseUrl . $wgUploadPathManual:$wgUploadPath : $wgUploadPathManual:$wgUploadPath,
        'hashLevels' => $wgHashedUploadDirectoryManual:$wgHashedUploadDirectory ? 2 : 0,
        'thumbScriptUrl' => $wgThumbnailScriptPathManual:$wgThumbnailScriptPath,
        'transformVia404' => !$wgGenerateThumbnailOnParseManual:$wgGenerateThumbnailOnParse,
        'deletedDir' => $wgDeletedDirectoryManual:$wgDeletedDirectory,
        'deletedHashLevels' => $deletedHashLevel
    );
}

See also[edit]