Manual:$wgFileStore

From Linux Web Expert

<translate> Files and file uploads</translate>: $wgFileStore
File storage paths; currently used only for deleted files.
<translate> Introduced in version:</translate>1.7.0 (r14777)
<translate> Deprecated in version:</translate>1.17.0 (r69007)
<translate> Removed in version:</translate>1.24.0 (Gerrit change 145738; git #5842d0aa)
<translate> Allowed values:</translate>see below
<translate> Default value:</translate>see below

Details

File storage paths; was last used only for deleted files.

The setting contains an array of arrays. The first index is the name of the type of file being stored (currently only 'deleted' is valid) and the second index is one of the following three keys:

  • 'directory' contains the directory on the server where the files will be saved. As of version 1.17, this is superseded by $wgDeletedDirectory .
  • 'url' contains the URL used to access the file over the internet.

If the file is private (as for deleted files) this should be null. As of version 1.23, this value is ignored.

  • 'hash' contains the number of levels of subdirectory to create under the specified directory. E.g. if you set this to 3, images will be stored in paths such as /a/b/a/Abacus.jpg (relative to the above directories).

As of version 1.17, this is superseded by $wgHashedUploadDirectory .

Default values

<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.23</tvar> is unsupported version</translate>">
1.11 – 1.23
<translate> MediaWiki versions:</translate>

Deleted images are stored by default in "$wgUploadDirectory /deleted". $wgFileStore can be used to customize this:

The default settings are:

$wgFileStore['deleted']['directory'] = false;// Defaults to $wgUploadDirectory/deleted
$wgFileStore['deleted']['url'] = null;       // Private, so set to null
$wgFileStore['deleted']['hash'] = 3;         // 3-level subdirectory split
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.10</tvar> is unsupported version</translate>">
1.7 – 1.10
<translate> MediaWiki versions:</translate>

Prior to MediaWiki 1.11, deleted files are simply discarded by default; see $wgSaveDeletedFiles for how to enable storing them. To enable undeletion, the 'deleted directory' must be defined and $wgSaveDeletedFiles must be true.

The default settings are:

$wgFileStore = array();
$wgFileStore['deleted']['directory'] = null; // Don't forget to set this.
$wgFileStore['deleted']['url'] = null;       // Private
$wgFileStore['deleted']['hash'] = 3;         // 3-level subdirectory split

Example

An example enabling saving deleted images:

$wgSaveDeletedFiles = true;                                    // Not required in MW 1.11.0 and above.
$wgFileStore['deleted']['directory'] = "$IP/imagesDeleted";
$wgFileStore['deleted']['url'] = null; 
$wgFileStore['deleted']['hash'] = 3;

The 'deleted url' can remain null (as the deleted files are private, not visible to the Internet).

See also