MediaWiki master
ProtectAction.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Actions;
22
31
32 public function getName() {
33 return 'protect';
34 }
35
36 public function onView() {
37 return null;
38 }
39
40 public function show() {
41 $this->getArticle()->protect();
42 }
43
44 public function doesWrites() {
45 return true;
46 }
47}
48
50class_alias( ProtectAction::class, 'ProtectAction' );
getArticle()
Get a Article object.
Definition Action.php:216
An action which just does something, without showing a form first.
Handle page protection (action=protect)
onView()
Show something on GET request.
doesWrites()
Indicates whether POST requests handled by this action require write access to the wiki.
getName()
Return the name of the action this object responds to.