53 'BrokenRedirects' =>
'BrokenRedirectsPage',
54 'Deadendpages' =>
'DeadendPagesPage',
55 'DoubleRedirects' =>
'DoubleRedirectsPage',
56 'Longpages' =>
'LongPagesPage',
57 'Ancientpages' =>
'AncientPagesPage',
58 'Lonelypages' =>
'LonelyPagesPage',
59 'Fewestrevisions' =>
'FewestrevisionsPage',
60 'Withoutinterwiki' =>
'WithoutInterwikiPage',
61 'Protectedpages' =>
'SpecialProtectedpages',
62 'Protectedtitles' =>
'SpecialProtectedtitles',
63 'Shortpages' =>
'ShortPagesPage',
64 'Uncategorizedcategories' =>
'UncategorizedCategoriesPage',
65 'Uncategorizedimages' =>
'UncategorizedImagesPage',
66 'Uncategorizedpages' =>
'UncategorizedPagesPage',
67 'Uncategorizedtemplates' =>
'UncategorizedTemplatesPage',
68 'Unusedcategories' =>
'UnusedCategoriesPage',
69 'Unusedimages' =>
'UnusedimagesPage',
70 'Unusedtemplates' =>
'UnusedtemplatesPage',
71 'Unwatchedpages' =>
'UnwatchedpagesPage',
72 'Wantedcategories' =>
'WantedCategoriesPage',
73 'Wantedfiles' =>
'WantedFilesPage',
74 'Wantedpages' =>
'WantedPagesPage',
75 'Wantedtemplates' =>
'WantedTemplatesPage',
78 'Allpages' =>
'SpecialAllPages',
79 'Prefixindex' =>
'SpecialPrefixindex',
80 'Categories' =>
'SpecialCategories',
81 'Listredirects' =>
'ListredirectsPage',
82 'PagesWithProp' =>
'SpecialPagesWithProp',
83 'TrackingCategories' =>
'SpecialTrackingCategories',
86 'Userlogin' =>
'SpecialUserLogin',
87 'Userlogout' =>
'SpecialUserLogout',
88 'CreateAccount' =>
'SpecialCreateAccount',
89 'LinkAccounts' =>
'SpecialLinkAccounts',
90 'UnlinkAccounts' =>
'SpecialUnlinkAccounts',
91 'ChangeCredentials' =>
'SpecialChangeCredentials',
92 'RemoveCredentials' =>
'SpecialRemoveCredentials',
95 'Activeusers' =>
'SpecialActiveUsers',
96 'Block' =>
'SpecialBlock',
97 'Unblock' =>
'SpecialUnblock',
98 'BlockList' =>
'SpecialBlockList',
99 'ChangePassword' =>
'SpecialChangePassword',
100 'BotPasswords' =>
'SpecialBotPasswords',
101 'PasswordReset' =>
'SpecialPasswordReset',
102 'DeletedContributions' =>
'DeletedContributionsPage',
103 'Preferences' =>
'SpecialPreferences',
104 'ResetTokens' =>
'SpecialResetTokens',
105 'Contributions' =>
'SpecialContributions',
106 'Listgrouprights' =>
'SpecialListGroupRights',
107 'Listgrants' =>
'SpecialListGrants',
108 'Listusers' =>
'SpecialListUsers',
109 'Listadmins' =>
'SpecialListAdmins',
110 'Listbots' =>
'SpecialListBots',
111 'Userrights' =>
'UserrightsPage',
112 'EditWatchlist' =>
'SpecialEditWatchlist',
115 'Newimages' =>
'SpecialNewFiles',
116 'Log' =>
'SpecialLog',
117 'Watchlist' =>
'SpecialWatchlist',
118 'Newpages' =>
'SpecialNewpages',
119 'Recentchanges' =>
'SpecialRecentChanges',
120 'Recentchangeslinked' =>
'SpecialRecentChangesLinked',
121 'Tags' =>
'SpecialTags',
124 'Listfiles' =>
'SpecialListFiles',
125 'Filepath' =>
'SpecialFilepath',
126 'MediaStatistics' =>
'MediaStatisticsPage',
127 'MIMEsearch' =>
'MIMEsearchPage',
128 'FileDuplicateSearch' =>
'FileDuplicateSearchPage',
129 'Upload' =>
'SpecialUpload',
130 'UploadStash' =>
'SpecialUploadStash',
131 'ListDuplicatedFiles' =>
'ListDuplicatedFilesPage',
134 'ApiSandbox' =>
'SpecialApiSandbox',
135 'Statistics' =>
'SpecialStatistics',
136 'Allmessages' =>
'SpecialAllMessages',
137 'Version' =>
'SpecialVersion',
138 'Lockdb' =>
'SpecialLockdb',
139 'Unlockdb' =>
'SpecialUnlockdb',
142 'LinkSearch' =>
'LinkSearchPage',
143 'Randompage' =>
'RandomPage',
144 'RandomInCategory' =>
'SpecialRandomInCategory',
145 'Randomredirect' =>
'SpecialRandomredirect',
146 'Randomrootpage' =>
'SpecialRandomrootpage',
147 'GoToInterwiki' =>
'SpecialGoToInterwiki',
150 'Mostlinkedcategories' =>
'MostlinkedCategoriesPage',
151 'Mostimages' =>
'MostimagesPage',
152 'Mostinterwikis' =>
'MostinterwikisPage',
153 'Mostlinked' =>
'MostlinkedPage',
154 'Mostlinkedtemplates' =>
'MostlinkedTemplatesPage',
155 'Mostcategories' =>
'MostcategoriesPage',
156 'Mostrevisions' =>
'MostrevisionsPage',
159 'ComparePages' =>
'SpecialComparePages',
160 'Export' =>
'SpecialExport',
161 'Import' =>
'SpecialImport',
162 'Undelete' =>
'SpecialUndelete',
163 'Whatlinkshere' =>
'SpecialWhatLinksHere',
164 'MergeHistory' =>
'SpecialMergeHistory',
165 'ExpandTemplates' =>
'SpecialExpandTemplates',
168 'Booksources' =>
'SpecialBookSources',
171 'ApiHelp' =>
'SpecialApiHelp',
172 'Blankpage' =>
'SpecialBlankpage',
173 'Diff' =>
'SpecialDiff',
174 'EditTags' =>
'SpecialEditTags',
175 'Emailuser' =>
'SpecialEmailUser',
176 'Movepage' =>
'MovePageForm',
177 'Mycontributions' =>
'SpecialMycontributions',
178 'MyLanguage' =>
'SpecialMyLanguage',
179 'Mypage' =>
'SpecialMypage',
180 'Mytalk' =>
'SpecialMytalk',
181 'Myuploads' =>
'SpecialMyuploads',
182 'AllMyUploads' =>
'SpecialAllMyUploads',
183 'PermanentLink' =>
'SpecialPermanentLink',
184 'Redirect' =>
'SpecialRedirect',
185 'Revisiondelete' =>
'SpecialRevisionDelete',
186 'RunJobs' =>
'SpecialRunJobs',
187 'Specialpages' =>
'SpecialSpecialpages',
190 private static $list;
199 self::$aliases = null;
209 return array_keys( self::getPageList() );
220 return self::getPageList();
232 global $wgPageLanguageUseDB, $wgContentHandlerUseDB;
234 if ( !is_array( self::$list ) ) {
236 self::$list = self::$coreList;
238 if ( !$wgDisableInternalSearch ) {
239 self::$list[
'Search'] =
'SpecialSearch';
242 if ( $wgEmailAuthentication ) {
243 self::$list[
'Confirmemail'] =
'EmailConfirmation';
244 self::$list[
'Invalidateemail'] =
'EmailInvalidation';
247 if ( $wgEnableEmail ) {
248 self::$list[
'ChangeEmail'] =
'SpecialChangeEmail';
251 if ( $wgEnableJavaScriptTest ) {
252 self::$list[
'JavaScriptTest'] =
'SpecialJavaScriptTest';
255 if ( $wgPageLanguageUseDB ) {
256 self::$list[
'PageLanguage'] =
'SpecialPageLanguage';
258 if ( $wgContentHandlerUseDB ) {
259 self::$list[
'ChangeContentModel'] =
'SpecialChangeContentModel';
263 self::$list = array_merge( self::$list, $wgSpecialPages );
267 Hooks::run(
'SpecialPage_initList', [ &self::$list ] );
281 if ( is_null( self::$aliases ) ) {
283 $aliases = $wgContLang->getSpecialPageAliases();
284 $pageList = self::getPageList();
290 foreach ( $pageList
as $name => $stuff ) {
291 $caseFoldedAlias = $wgContLang->caseFold(
$name );
292 self::$aliases[$caseFoldedAlias] =
$name;
293 $keepAlias[$caseFoldedAlias] =
'canonical';
298 foreach (
$aliases as $realName => $aliasList ) {
299 $aliasList = array_values( $aliasList );
300 foreach ( $aliasList
as $i => $alias ) {
301 $caseFoldedAlias = $wgContLang->caseFold( $alias );
303 if ( isset( self::$aliases[$caseFoldedAlias] ) &&
304 $realName === self::$aliases[$caseFoldedAlias]
310 if ( !isset( $keepAlias[$caseFoldedAlias] ) ) {
311 self::$aliases[$caseFoldedAlias] = $realName;
313 $keepAlias[$caseFoldedAlias] =
'first';
316 wfWarn(
"First alias '$alias' for $realName conflicts with " .
317 "{$keepAlias[$caseFoldedAlias]} alias for " .
318 self::$aliases[$caseFoldedAlias]
326 return self::$aliases;
339 $bits = explode(
'/', $alias, 2 );
341 $caseFoldedAlias = $wgContLang->caseFold( $bits[0] );
342 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
344 if ( isset(
$aliases[$caseFoldedAlias] ) ) {
347 return [ null, null ];
350 if ( !isset( $bits[1] ) ) {
356 return [
$name, $par ];
368 $specialPageList = self::getPageList();
369 return isset( $specialPageList[
$title] );
379 list( $realName, ) = self::resolveAlias(
$name );
381 $specialPageList = self::getPageList();
383 if ( isset( $specialPageList[$realName] ) ) {
384 $rec = $specialPageList[$realName];
386 if ( is_callable( $rec ) ) {
388 $page = call_user_func( $rec );
389 } elseif ( is_string( $rec ) ) {
391 $page =
new $className;
392 } elseif ( is_array( $rec ) ) {
393 $className = array_shift( $rec );
395 wfDeprecated(
"Array syntax for \$wgSpecialPages is deprecated ($className), " .
396 "define a subclass of SpecialPage instead.",
'1.18' );
398 'class' => $className,
400 'closure_expansion' =>
false,
408 if (
$page instanceof SpecialPage ) {
413 wfLogWarning(
"Cannot instantiate special page $realName: bad spec!" );
432 if (
$user === null ) {
436 foreach ( self::getPageList()
as $name => $rec ) {
440 if (
$page->isListed()
458 foreach ( self::getPageList()
as $name => $rec ) {
460 if (
$page->isListed() && !
$page->isRestricted() ) {
477 if (
$user === null ) {
481 foreach ( self::getPageList()
as $name => $rec ) {
485 &&
$page->isRestricted()
514 $bits = explode(
'/', $title->
getDBkey(), 2 );
516 if ( !isset( $bits[1] ) ) {
522 $page = self::getPage( $name );
524 $context->
getOutput()->setArticleRelated(
false );
525 $context->
getOutput()->setRobotPolicy(
'noindex,nofollow' );
528 if ( $wgSend404Code ) {
529 $context->
getOutput()->setStatusCode( 404 );
532 $context->
getOutput()->showErrorPage(
'nosuchspecialpage',
'nospecialpagetext' );
539 $trxLimits = $context->
getConfig()->get(
'TrxProfilerLimits' );
542 $trxProfiler->setExpectations( $trxLimits[
'POST-nonwrite'], __METHOD__ );
548 $page->setContext( $context );
556 if ( $name !=
$page->getLocalName() && !$context->
getRequest()->wasPosted() ) {
559 $title =
$page->getPageTitle( $par );
565 $context->setTitle(
$page->getPageTitle( $par ) );
567 } elseif ( !
$page->isIncludable() ) {
571 $page->including( $including );
612 'title' => $main->getTitle(),
613 'output' => $main->getOutput(),
614 'request' => $main->getRequest(),
615 'user' => $main->getUser(),
616 'language' => $main->getLanguage(),
625 $main->setTitle( $title );
626 $main->setOutput( $context->
getOutput() );
628 $main->setUser( $context->
getUser() );
635 $wgTitle = $glob[
'title'];
636 $wgOut = $glob[
'output'];
637 $wgRequest = $glob[
'request'];
638 $wgUser = $glob[
'user'];
639 $wgLang = $glob[
'language'];
640 $main->setTitle( $ctx[
'title'] );
641 $main->setOutput( $ctx[
'output'] );
642 $main->setRequest( $ctx[
'request'] );
643 $main->setUser( $ctx[
'user'] );
644 $main->setLanguage( $ctx[
'language'] );
658 $aliases = $wgContLang->getSpecialPageAliases();
659 $aliasList = self::getAliasList();
665 $caseFoldedAlias = $wgContLang->caseFold( $alias );
666 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
667 if ( isset( $aliasList[$caseFoldedAlias] ) &&
668 $aliasList[$caseFoldedAlias] === $name
676 wfWarn(
"Did not find a usable alias for special page '$name'. " .
677 "It seems all defined aliases conflict?" );
683 if ( strcasecmp( $name, $n ) === 0 ) {
684 wfWarn(
"Found alias defined for $n when searching for " .
685 "special page aliases for $name. Case mismatch?" );
686 return self::getLocalNameFor( $n, $subpage );
691 wfWarn(
"Did not find alias for special page '$name'. " .
692 "Perhaps no aliases are defined for it?" );
695 if ( $subpage !==
false && !is_null( $subpage ) ) {
697 $subpage = str_replace(
' ',
'_', $subpage );
698 $name =
"$name/$subpage";
701 return $wgContLang->ucfirst( $name );
711 list(
$name, $subpage ) = self::resolveAlias( $alias );
712 if (
$name != null ) {
static getTitleForAlias($alias)
Get a title for a given alias.
Interface for objects which can provide a MediaWiki context on request.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
static getLocalNameFor($name, $subpage=false)
Get the local name for a specified canonical name.
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
static getObjectFromSpec($spec)
Instantiate an object based on a specification array.
static getRegularPages()
Return categorised listable special pages for all users.
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 & $ret
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name If you don't need a full Title object...
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 an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
if(!$wgDBerrorLogTZ) $wgRequest
static instance()
Singleton.
static $coreList
List of special page names to the subclass of SpecialPage which handles them.
static getList()
Get the special page list as an array.
when a variable name is used in a it is silently declared as a new local masking the global
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
getUser()
Get the User object.
static getPage($name)
Find the object with a given name and return it (or NULL)
Parent class for all special pages.
getConfig()
Get the site configuration.
static getMain()
Static methods.
Factory for handling the special page list and generating SpecialPage objects.
getDBkey()
Get the main part with underscores.
wfWarn($msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
static getAliasList()
Initialise and return the list of special page aliases.
static getNames()
Returns a list of canonical special page names.
static getRestrictedPages(User $user=null)
Return categorised listable special pages which are available for the current user, but not for everyone.
wfDeprecated($function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static resetList()
Reset the internal list of special pages.
static capturePath(Title $title, IContextSource $context, LinkRenderer $linkRenderer=null)
Just like executePath() but will override global variables and execute the page in "inclusion" mode...
namespace and then decline to actually register it file or subcat img or subcat $title
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
getLanguage()
Get the Language object.
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
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
static getUsablePages(User $user=null)
Return categorised listable special pages which are available for the current user, and everyone.
$wgEmailAuthentication
Require email authentication before sending mail to an email address.
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
static resolveAlias($alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
static exists($name)
Check if a given name exist as a special page or as a special page alias.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
static executePath(Title &$title, IContextSource &$context, $including=false, LinkRenderer $linkRenderer=null)
Execute a special page path.
getOutput()
Get the OutputPage object.
wfLogWarning($msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
if(!$wgRequest->checkUrlExtension()) if(!$wgEnableAPI) $wgTitle
static getPageList()
Get the special page list as an array.
$wgSend404Code
Some web hosts attempt to rewrite all responses with a 404 (not found) status code, mangling or hiding MediaWiki's output.
getRequest()
Get the WebRequest object.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
getFullURL($query= '', $query2=false, $proto=PROTO_RELATIVE)
Get a real URL referring to this title, with interwiki link and fragment.
Allows to change the fields on the form that will be generated $name