Extension:DataDump/zh

This page is a translated version of the page Extension:DataDump and the translation is 5% complete.
Other languages:
Deutsch • ‎English • ‎Türkçe • ‎français • ‎中文 • ‎日本語
MediaWiki扩展手册
OOjs UI icon advanced.svg
DataDump
发布状态: 测试
实现 資料庫 , 特殊页面
描述 Provides the Special page to generate/delete/download dumps
作者 Paladoxtalk
维护者 Miraheze
最新版本 continuous updates
MediaWiki 1.31+
PHP 7.0+
数据庫更新
许可协议 GNU通用公眾授權條款3.0或更新版本
下载

  • $wgDataDump

  • view-dump
  • view-image-dump
  • generate-dump
  • delete-dump
检查使用和版本矩阵。

The DataDump extension provides means for users to generate, delete or download their dump without the involvement of sysadmins.

For reporting an issue or a bug, please use Miraheze Phabricator.

Installation

  • 下载文件,并将其放置在您extensions/文件夹中的DataDump目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'DataDump' );
    
  • 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
  • Configure as required.
  •   完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

Configuration

parameter default comment
$wgDataDump [] This config defines how dumps are generated and which types of dumps there are.
$wgDataDumpInfo "" This config defines the information displayed atop Special:DataDump.
$wgDataDumpLimits ["memory": 0, "filesize": 0, "time": 0, "walltime": 0] This config defines resources allocated to running scripts.
$wgDataDumpDirectory false This config defines the directory where to store the dumps.
$wgDataDumpFileBackend false This config defines backend to use ($wgFileBackends)

Example

This is an example on how to setup the configuration. You can tailor it to your specific needs:

$wgDataDumpDirectory = "<path>${wgDBname}/";

$wgDataDump = [
    'xml' => [
        'file_ending' => '.xml.gz',
        'generate' => [
            'type' => 'mwscript',
            'script' => "$IP/maintenance/dumpBackup.php",
            'options' => [
                '--full',
                '--output',
                "gzip:${wgDataDumpDirectory}" . '${filename}',
            ],
        ],
        'limit' => 1,
        'permissions' => [
            'view' => 'view-dump',
            'generate' => 'generate-dump',
            'delete' => 'delete-dump',
        ],
    ],
    'image' => [
        'file_ending' => '.zip',
        'generate' => [
            'type' => 'script',
            'script' => '/usr/bin/zip',
            'options' => [
                '-r',
                '<path>${filename}',
                "<path>${wgDBname}/"
            ],
        ],
        'limit' => 1,
        'permissions' => [
            'view' => 'view-dump',
            'generate' => 'view-image-dump',
            'delete' => 'delete-dump',
        ],
    ],
];

$wgAvailableRights[] = 'view-dump';
$wgAvailableRights[] = 'view-image-dump';
$wgAvailableRights[] = 'generate-dump';
$wgAvailableRights[] = 'delete-dump';

Note that ${filename} is replaced internally in the extension so make sure that it is always in a single string not in a double string.

The limit parameter specifies how many dumps can be generated for that wiki.

See also