Manual:データベースをロックする
Appearance
MediaWiki 1.5から$wgReadOnly
を"LocalSettings.php" file 内に追加できるようになりました。読み取り専用モードの理由を記述する文字列に設定することができます。
(Usual wiki markup is allowed in this string.)
これはウィキでの編集を制限するためです。
例:
$wgReadOnly = "We are upgrading MediaWiki, please be patient. This wiki will be back in a few hours.";
Alternatively, set $wgReadOnlyFile
in the "LocalSettings.php" file to the name of a file, then put the reason for the lock inside the file.
The file's contents will be displayed to anyone trying to edit the wiki.
Note that the read-only mode does not prevent all writes to the database. If you need to prevent all writes, you need to do this on the database itself (e.g., revoke UPDATE, INSERT, DELETE from the wiki user, or put MySQL into read-only mode).
If you have the siteadmin permission, you can also use the special page "Special:Lockdb" to lock the database and "Special:Unlockdb" to unlock a previously locked database. Note that this is deprecated, and the siteadmin permission is not granted to any group per default. グループへの権限付与については、Manual:利用者権限 を参照してください。 Also note that this works by writing or deleting the file specified by
$wgReadOnlyFile
, so make sure the file permissions are set appropriately.