Manual:Protect.php
Appearance
| Berkas MediaWiki: protect.php | |
|---|---|
| Lokasi: | maintenance/ |
| Kode sumber: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Kelas: | Protect |
Rincian
Berkas protect.php adalah sebuah skrip pemeliharaan yang menangani tugas melindungi dan mencabut perlindungan suatu halaman.
Options/Arguments
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:
| Option | Required | Default value | |
|---|---|---|---|
| --unprotect | Removes protection | Opsional | |
| --semiprotect | Adds semi-protection | Opsional | |
| --cascade | Add cascading protection | Opsional | |
| --user | Username to protect with | Opsional | |
| --reason | Reason for un/protection | Opsional |
Usage
php maintenance/run.php protect title [ --unprotect| --semiprotect| --cascade| --user| --reason ]
In MediaWiki version 1.43.6 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php instead of php maintenance/run.php scriptName.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