74 return strtolower( $this->
getName() );
98 $form->setSubmitCallback( [ $this,
'onSubmit' ] );
106 if ( !$headerMsg->isDisabled() ) {
107 $form->addHeaderText( $headerMsg->parseAsBlock() );
110 $form->addPreText( $this->
preText() );
111 $form->addPostText( $this->
postText() );
113 if ( $form->getMethod() ==
'post' ) {
116 $this->
getRequest()->getQueryValues(), [
'title' => null ] );
155 if ( $form->show() ) {
the array() calling protocol came about after MediaWiki 1.4rc1.
getContext()
Gets the context this SpecialPage is executed in.
preText()
Add pre-text to the form.
setParameter($par)
Maybe do something interesting with the subpage parameter.
onSubmit(array $data)
Process the form on POST submission.
msg()
Wrapper around wfMessage that sets the current context.
getDisplayFormat()
Get display format for the form.
Special page which uses an HTMLForm to handle processing.
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
getFormFields()
Get an HTMLForm descriptor array.
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
getBlock($bFromSlave=true)
Get the block affecting the user, or null if the user is not blocked.
Parent class for all special pages.
postText()
Add post-text to the form.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes! ...
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Show an error when the user tries to do something whilst blocked.
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 local account $user
isBlocked($bFromSlave=true)
Check if user is blocked.
getMessagePrefix()
Get message prefix for HTMLForm.
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
execute($par)
Basic SpecialPage workflow: get a form, send it to the user; get some data back,. ...
getName()
Get the name of this Special Page.
requiresUnblock()
Whether this action cannot be executed by a blocked user.
getUser()
Shortcut to get the User executing this instance.
string $par
The sub-page of the special page.
getForm()
Get the HTMLForm to control behavior.
wfArrayToCgi($array1, $array2=null, $prefix= '')
This function takes one or two arrays as input, and returns a CGI-style string, e.g.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
getRequest()
Get the WebRequest being used for this instance.
onSuccess()
Do something exciting on successful processing of the form, most likely to show a confirmation messag...
requiresWrite()
Whether this action requires the wiki not to be locked.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.