Go to the documentation of this file.
80 return strtolower( $this->
getName() );
99 $onSubmit = [ $this,
'onSubmit' ];
101 if ( $this->reauthPostData ) {
106 $oldRequest, $this->reauthPostData + $oldRequest->getQueryValues(),
true
111 $onSubmit =
function () {
122 $form->setSubmitCallback( $onSubmit );
130 if ( !$headerMsg->isDisabled() ) {
131 $form->addHeaderText( $headerMsg->parseAsBlock() );
134 $form->addPreText( $this->
preText() );
135 $form->addPostText( $this->
postText() );
137 if ( $form->getMethod() ==
'post' ) {
140 $this->
getRequest()->getQueryValues(), [
'title' =>
null ] );
184 if ( $form->show() ) {
207 $block =
$user->getBlock();
239 $this->reauthPostData = $data;
onSuccess()
Do something exciting on successful processing of the form, most likely to show a confirmation messag...
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
getFormFields()
Get an HTMLForm descriptor array.
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
requiresUnblock()
Whether this action cannot be executed by a blocked user.
onSubmit(array $data)
Process the form on POST submission.
msg( $key)
Wrapper around wfMessage that sets the current context.
getForm()
Get the HTMLForm to control behavior.
Show an error when the user tries to do something whilst blocked.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
requiresWrite()
Whether this action requires the wiki not to be locked.
setParameter( $par)
Maybe do something interesting with the subpage parameter.
Special page which uses an HTMLForm to handle processing.
preText()
Add pre-text to the form.
getName()
Get the name of this Special Page.
postText()
Add post-text to the form.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
getMessagePrefix()
Get message prefix for HTMLForm.
An IContextSource implementation which will inherit context from another source but allow individual ...
array null $reauthPostData
POST data preserved across re-authentication.
checkLoginSecurityLevel( $level=null)
Verifies that the user meets the security level, possibly reauthenticating them in the process.
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
execute( $par)
Basic SpecialPage workflow: get a form, send it to the user; get some data back,.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
getContext()
Gets the context this SpecialPage is executed in.
getDisplayFormat()
Get display format for the form.
string $par
The sub-page of the special page.
Parent class for all special pages.
getRequest()
Get the WebRequest being used for this instance.
getLoginSecurityLevel()
Tells if the special page does something security-sensitive and needs extra defense against a stolen ...
setReauthPostData(array $data)
Preserve POST data across reauthentication.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
isBlocked( $bFromSlave=true)
Check if user is blocked.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....