Extension:DataDump

This page is a translated version of the page Extension:DataDump and the translation is 59% complete.
MediaWiki 拡張機能マニュアル
DataDump
リリースの状態: 安定
実装 データベース , 特別ページ
説明 ダンプを生成/削除/ダウンロードする特別ページを提供する
メンテナー Miraheze system administrators
最新バージョン continuous updates
MediaWiki 1.36.0+
PHP 7.2+
データベースの変更 はい
Composer miraheze/data-dump
テーブル data_dump
ライセンス 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.

問題やバグを報告するには、Miraheze Phabricatorを使用してください。 ワークボードについてはこちらを参照してください。

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のDataDumpという名前のディレクトリ内に配置します。
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'DataDump' );
    
  • 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
  • 必要に応じて設定します。
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定

パラメーター 既定 コメント
$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)

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.

関連項目