Manual:protect.php
MediaWiki ファイル: protect.php | |
---|---|
場所: | maintenance/ |
ソース コード: | master • 1.43.1 • 1.42.6 • 1.39.12 |
クラス: | Protect |
詳細
protect.php ファイルは、ページの保護と保護解除を扱うメンテナンス スクリプトです。
オプション/引数
This script takes the title of the page as the first argument.
Tip: Spaces inside a title must be replaced with underscores ( _ ), or use double quotation marks like "Foo Bar"
This script accepts these options:
オプション | 必須かどうか | 既定値 | |
---|---|---|---|
--unprotect | Removes protection | 省略可能 | |
--semiprotect | Adds semi-protection | 省略可能 | |
--cascade | Add cascading protection | 省略可能 | |
--user | Username to protect with | 省略可能 | |
--reason | Reason for un/protection | 省略可能 |
使用法
php maintenance/run.php protect title [ --unprotect| --semiprotect| --cascade| --user| --reason ]
MediaWiki バージョン 1.39.12 以前では、メンテナンス スクリプトを
php maintenance/run.php scriptName
ではなく php maintenance/scriptName.php
を使用して実行する必要があります。Allowing only autoconfirmed users to edit the page
Terminal
$ php maintenance/run.php protect "Lorem" --semiprotect --reason "Allowing only autoconfirmed users to edit" Updating protection status... done
Allowing only sysop users to edit the page
Terminal
$ php maintenance/run.php protect "Lorem" --cascade --reason "Allowing only sysop users to edit" Updating protection status... done
Removing protection from a page
Terminal
$ php maintenance/run.php protect "Lorem" --unprotect --reason "Removing protection" Updating protection status... done
Protecting a page as username "Foo"
If you don't pass the --user option to the script, it will perform the action with user User:Maintenance script.
Terminal
$ php maintenance/run.php protect "Lorem" --cascade --user "Foo" --reason "Allowing only sysop users to edit" Updating protection status... done