52 parent::__construct(
'Redirect' );
63 $parts = explode(
'/', $subpage, 2 );
64 $this->mType = count( $parts ) > 0 ? $parts[0] :
null;
65 $this->mValue = count( $parts ) > 1 ? $parts[1] :
null;
74 if ( !ctype_digit( $this->mValue ) ) {
77 $user = User::newFromId( (
int)$this->mValue );
79 if (
$user->isAnon() ) {
100 if ( !$file || !$file->exists() ) {
104 $url = $file->getUrl();
106 $width =
$request->getInt(
'width', -1 );
107 $height =
$request->getInt(
'height', -1 );
110 if ( $width != -1 ) {
111 $mto = $file->transform( [
'width' => $width,
'height' => $height ] );
113 if ( $mto && !$mto->isError() ) {
115 $url = $mto->getUrl();
130 if ( !ctype_digit( $oldid ) ) {
133 $oldid = (int)$oldid;
134 if ( $oldid === 0 ) {
150 if ( !ctype_digit( $curid ) ) {
153 $curid = (int)$curid;
154 if ( $curid === 0 ) {
172 if ( !ctype_digit( $logid ) ) {
175 $logid = (int)$logid;
176 if ( $logid === 0 ) {
180 $query = [
'title' =>
'Special:Log',
'logid' => $logid ];
194 switch ( $this->mType ) {
219 if ( !is_null( $this->mValue ) ) {
220 $this->
getOutput()->setStatusCode( 404 );
224 return Status::newFatal( $msg );
236 'user' => $mp .
'-user',
237 'page' => $mp .
'-page',
238 'revision' => $mp .
'-revision',
239 'file' => $mp .
'-file',
240 'logid' => $mp .
'-logid',
245 'label-message' => $mp .
'-lookup',
247 'default' => current( array_keys( $ns ) ),
249 foreach ( $ns
as $n => $m ) {
250 $m = $this->
msg( $m )->text();
251 $a[
'type'][
'options'][$m] = $n;
255 'label-message' => $mp .
'-value'
258 if ( !empty( $this->mType ) ) {
261 if ( !empty( $this->mValue ) ) {
269 if ( !empty( $data[
'type'] ) && !empty( $data[
'value'] ) ) {
270 $this->
setParameter( $data[
'type'] .
'/' . $data[
'value'] );
wfFindFile( $title, $options=[])
Find a file.
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Special page which uses an HTMLForm to handle processing.
getMessagePrefix()
Get message prefix for HTMLForm.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
getOutput()
Get the OutputPage being used for this instance.
msg( $key)
Wrapper around wfMessage that sets the current context.
getRequest()
Get the WebRequest being used for this instance.
A special page that redirects to: the user for a numeric user id, the file for a given filename,...
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept.
setParameter( $subpage)
Set $mType and $mValue based on parsed value of $subpage.
onSubmit(array $data)
Process the form on POST submission.
getDisplayFormat()
Get display format for the form.
dispatchLog()
Handle Special:Redirect/logid/xxx (by redirecting to index.php?title=Special:Log&logid=xxx)
getFormFields()
Get an HTMLForm descriptor array.
onSuccess()
Do something exciting on successful processing of the form, most likely to show a confirmation messag...
dispatchUser()
Handle Special:Redirect/user/xxxx (by redirecting to User:YYYY)
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
dispatch()
Use appropriate dispatch* method to obtain a redirection URL, and either: redirect,...
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
dispatchRevision()
Handle Special:Redirect/revision/xxx (by redirecting to index.php?oldid=xxx)
$mValue
The identifier/value for the redirect (which id, which file)
dispatchPage()
Handle Special:Redirect/page/xxx (by redirecting to index.php?curid=xxx)
dispatchFile()
Handle Special:Redirect/file/xxxx.
$mType
The type of the redirect (user/file/revision)
Represents a title within MediaWiki.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
the array() calling protocol came about after MediaWiki 1.4rc1.
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 $request
namespace and then decline to actually register it file or subcat img or subcat $title
this hook is for auditing only or null if authentication failed before getting that far $username
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
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
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