52 'BrokenRedirects' =>
'BrokenRedirectsPage',
53 'Deadendpages' =>
'DeadendPagesPage',
54 'DoubleRedirects' =>
'DoubleRedirectsPage',
55 'Longpages' =>
'LongPagesPage',
56 'Ancientpages' =>
'AncientPagesPage',
57 'Lonelypages' =>
'LonelyPagesPage',
58 'Fewestrevisions' =>
'FewestrevisionsPage',
59 'Withoutinterwiki' =>
'WithoutInterwikiPage',
60 'Protectedpages' =>
'SpecialProtectedpages',
61 'Protectedtitles' =>
'SpecialProtectedtitles',
62 'Shortpages' =>
'ShortPagesPage',
63 'Uncategorizedcategories' =>
'UncategorizedCategoriesPage',
64 'Uncategorizedimages' =>
'UncategorizedImagesPage',
65 'Uncategorizedpages' =>
'UncategorizedPagesPage',
66 'Uncategorizedtemplates' =>
'UncategorizedTemplatesPage',
67 'Unusedcategories' =>
'UnusedCategoriesPage',
68 'Unusedimages' =>
'UnusedimagesPage',
69 'Unusedtemplates' =>
'UnusedtemplatesPage',
70 'Unwatchedpages' =>
'UnwatchedpagesPage',
71 'Wantedcategories' =>
'WantedCategoriesPage',
72 'Wantedfiles' =>
'WantedFilesPage',
73 'Wantedpages' =>
'WantedPagesPage',
74 'Wantedtemplates' =>
'WantedTemplatesPage',
77 'Allpages' =>
'SpecialAllPages',
78 'Prefixindex' =>
'SpecialPrefixindex',
79 'Categories' =>
'SpecialCategories',
80 'Listredirects' =>
'ListredirectsPage',
81 'PagesWithProp' =>
'SpecialPagesWithProp',
82 'TrackingCategories' =>
'SpecialTrackingCategories',
85 'Userlogin' =>
'SpecialUserLogin',
86 'Userlogout' =>
'SpecialUserLogout',
87 'CreateAccount' =>
'SpecialCreateAccount',
88 'LinkAccounts' =>
'SpecialLinkAccounts',
89 'UnlinkAccounts' =>
'SpecialUnlinkAccounts',
90 'ChangeCredentials' =>
'SpecialChangeCredentials',
91 'RemoveCredentials' =>
'SpecialRemoveCredentials',
94 'Block' =>
'SpecialBlock',
95 'Unblock' =>
'SpecialUnblock',
96 'BlockList' =>
'SpecialBlockList',
97 'ChangePassword' =>
'SpecialChangePassword',
98 'BotPasswords' =>
'SpecialBotPasswords',
99 'PasswordReset' =>
'SpecialPasswordReset',
100 'DeletedContributions' =>
'DeletedContributionsPage',
101 'Preferences' =>
'SpecialPreferences',
102 'ResetTokens' =>
'SpecialResetTokens',
103 'Contributions' =>
'SpecialContributions',
104 'Listgrouprights' =>
'SpecialListGroupRights',
105 'Listgrants' =>
'SpecialListGrants',
106 'Listusers' =>
'SpecialListUsers',
107 'Listadmins' =>
'SpecialListAdmins',
108 'Listbots' =>
'SpecialListBots',
109 'Userrights' =>
'UserrightsPage',
110 'EditWatchlist' =>
'SpecialEditWatchlist',
113 'Newimages' =>
'SpecialNewFiles',
114 'Log' =>
'SpecialLog',
115 'Watchlist' =>
'SpecialWatchlist',
116 'Newpages' =>
'SpecialNewpages',
117 'Recentchanges' =>
'SpecialRecentChanges',
118 'Recentchangeslinked' =>
'SpecialRecentChangesLinked',
119 'Tags' =>
'SpecialTags',
122 'Listfiles' =>
'SpecialListFiles',
123 'Filepath' =>
'SpecialFilepath',
124 'MediaStatistics' =>
'MediaStatisticsPage',
125 'MIMEsearch' =>
'MIMEsearchPage',
126 'FileDuplicateSearch' =>
'FileDuplicateSearchPage',
127 'Upload' =>
'SpecialUpload',
128 'UploadStash' =>
'SpecialUploadStash',
129 'ListDuplicatedFiles' =>
'ListDuplicatedFilesPage',
132 'ApiSandbox' =>
'SpecialApiSandbox',
133 'Statistics' =>
'SpecialStatistics',
134 'Allmessages' =>
'SpecialAllMessages',
135 'Version' =>
'SpecialVersion',
136 'Lockdb' =>
'SpecialLockdb',
137 'Unlockdb' =>
'SpecialUnlockdb',
140 'LinkSearch' =>
'LinkSearchPage',
141 'Randompage' =>
'RandomPage',
142 'RandomInCategory' =>
'SpecialRandomInCategory',
143 'Randomredirect' =>
'SpecialRandomredirect',
144 'Randomrootpage' =>
'SpecialRandomrootpage',
147 'Mostlinkedcategories' =>
'MostlinkedCategoriesPage',
148 'Mostimages' =>
'MostimagesPage',
149 'Mostinterwikis' =>
'MostinterwikisPage',
150 'Mostlinked' =>
'MostlinkedPage',
151 'Mostlinkedtemplates' =>
'MostlinkedTemplatesPage',
152 'Mostcategories' =>
'MostcategoriesPage',
153 'Mostrevisions' =>
'MostrevisionsPage',
156 'ComparePages' =>
'SpecialComparePages',
157 'Export' =>
'SpecialExport',
158 'Import' =>
'SpecialImport',
159 'Undelete' =>
'SpecialUndelete',
160 'Whatlinkshere' =>
'SpecialWhatLinksHere',
161 'MergeHistory' =>
'SpecialMergeHistory',
162 'ExpandTemplates' =>
'SpecialExpandTemplates',
165 'Booksources' =>
'SpecialBookSources',
168 'ApiHelp' =>
'SpecialApiHelp',
169 'Blankpage' =>
'SpecialBlankpage',
170 'Diff' =>
'SpecialDiff',
171 'EditTags' =>
'SpecialEditTags',
172 'Emailuser' =>
'SpecialEmailUser',
173 'Movepage' =>
'MovePageForm',
174 'Mycontributions' =>
'SpecialMycontributions',
175 'MyLanguage' =>
'SpecialMyLanguage',
176 'Mypage' =>
'SpecialMypage',
177 'Mytalk' =>
'SpecialMytalk',
178 'Myuploads' =>
'SpecialMyuploads',
179 'AllMyUploads' =>
'SpecialAllMyUploads',
180 'PermanentLink' =>
'SpecialPermanentLink',
181 'Redirect' =>
'SpecialRedirect',
182 'Revisiondelete' =>
'SpecialRevisionDelete',
183 'RunJobs' =>
'SpecialRunJobs',
184 'Specialpages' =>
'SpecialSpecialpages',
187 private static $list;
197 self::$aliases = null;
198 self::$pageObjectCache = [];
208 return array_keys( self::getPageList() );
219 return self::getPageList();
231 global $wgPageLanguageUseDB, $wgContentHandlerUseDB;
233 if ( !is_array( self::$list ) ) {
235 self::$list = self::$coreList;
237 if ( !$wgDisableInternalSearch ) {
238 self::$list[
'Search'] =
'SpecialSearch';
241 if ( $wgEmailAuthentication ) {
242 self::$list[
'Confirmemail'] =
'EmailConfirmation';
243 self::$list[
'Invalidateemail'] =
'EmailInvalidation';
246 if ( $wgEnableEmail ) {
247 self::$list[
'ChangeEmail'] =
'SpecialChangeEmail';
250 if ( $wgEnableJavaScriptTest ) {
251 self::$list[
'JavaScriptTest'] =
'SpecialJavaScriptTest';
254 if ( $wgPageLanguageUseDB ) {
255 self::$list[
'PageLanguage'] =
'SpecialPageLanguage';
257 if ( $wgContentHandlerUseDB ) {
258 self::$list[
'ChangeContentModel'] =
'SpecialChangeContentModel';
261 self::$list[
'Activeusers'] =
'SpecialActiveUsers';
264 self::$list = array_merge( self::$list, $wgSpecialPages );
268 Hooks::run(
'SpecialPage_initList', [ &self::$list ] );
282 if ( is_null( self::$aliases ) ) {
284 $aliases = $wgContLang->getSpecialPageAliases();
285 $pageList = self::getPageList();
291 foreach ( $pageList
as $name => $stuff ) {
292 $caseFoldedAlias = $wgContLang->caseFold(
$name );
293 self::$aliases[$caseFoldedAlias] =
$name;
294 $keepAlias[$caseFoldedAlias] =
'canonical';
299 foreach (
$aliases as $realName => $aliasList ) {
300 $aliasList = array_values( $aliasList );
301 foreach ( $aliasList
as $i => $alias ) {
302 $caseFoldedAlias = $wgContLang->caseFold( $alias );
304 if ( isset( self::$aliases[$caseFoldedAlias] ) &&
305 $realName === self::$aliases[$caseFoldedAlias]
311 if ( !isset( $keepAlias[$caseFoldedAlias] ) ) {
312 self::$aliases[$caseFoldedAlias] = $realName;
314 $keepAlias[$caseFoldedAlias] =
'first';
317 wfWarn(
"First alias '$alias' for $realName conflicts with " .
318 "{$keepAlias[$caseFoldedAlias]} alias for " .
319 self::$aliases[$caseFoldedAlias]
327 return self::$aliases;
340 $bits = explode(
'/', $alias, 2 );
342 $caseFoldedAlias = $wgContLang->caseFold( $bits[0] );
343 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
345 if ( isset(
$aliases[$caseFoldedAlias] ) ) {
348 return [ null, null ];
351 if ( !isset( $bits[1] ) ) {
357 return [
$name, $par ];
369 $specialPageList = self::getPageList();
370 return isset( $specialPageList[
$title] );
380 list( $realName, ) = self::resolveAlias(
$name );
382 if ( isset( self::$pageObjectCache[$realName] ) ) {
383 return self::$pageObjectCache[$realName];
386 $specialPageList = self::getPageList();
388 if ( isset( $specialPageList[$realName] ) ) {
389 $rec = $specialPageList[$realName];
391 if ( is_callable( $rec ) ) {
393 $page = call_user_func( $rec );
394 } elseif ( is_string( $rec ) ) {
396 $page =
new $className;
397 } elseif ( is_array( $rec ) ) {
398 $className = array_shift( $rec );
400 wfDeprecated(
"Array syntax for \$wgSpecialPages is deprecated ($className), " .
401 "define a subclass of SpecialPage instead.",
'1.18' );
403 'class' => $className,
405 'closure_expansion' =>
false,
413 self::$pageObjectCache[$realName] =
$page;
414 if (
$page instanceof SpecialPage ) {
419 wfLogWarning(
"Cannot instantiate special page $realName: bad spec!" );
438 if (
$user === null ) {
442 foreach ( self::getPageList()
as $name => $rec ) {
446 if (
$page->isListed()
464 foreach ( self::getPageList()
as $name => $rec ) {
466 if (
$page->isListed() && !
$page->isRestricted() ) {
483 if (
$user === null ) {
487 foreach ( self::getPageList()
as $name => $rec ) {
491 &&
$page->isRestricted()
517 $bits = explode(
'/', $title->
getDBkey(), 2 );
519 if ( !isset( $bits[1] ) ) {
525 $page = self::getPage( $name );
527 $context->
getOutput()->setArticleRelated(
false );
528 $context->
getOutput()->setRobotPolicy(
'noindex,nofollow' );
531 if ( $wgSend404Code ) {
532 $context->
getOutput()->setStatusCode( 404 );
535 $context->
getOutput()->showErrorPage(
'nosuchspecialpage',
'nospecialpagetext' );
542 $trxLimits = $context->
getConfig()->get(
'TrxProfilerLimits' );
545 $trxProfiler->setExpectations( $trxLimits[
'POST-nonwrite'], __METHOD__ );
550 $page->setContext( $context );
558 if ( $name !=
$page->getLocalName() && !$context->
getRequest()->wasPosted() ) {
561 $title =
$page->getPageTitle( $par );
567 $context->setTitle(
$page->getPageTitle( $par ) );
569 } elseif ( !
$page->isIncludable() ) {
573 $page->including( $including );
608 'title' => $main->getTitle(),
609 'output' => $main->getOutput(),
610 'request' => $main->getRequest(),
611 'user' => $main->getUser(),
612 'language' => $main->getLanguage(),
621 $main->setTitle( $title );
622 $main->setOutput( $context->
getOutput() );
624 $main->setUser( $context->
getUser() );
628 $ret = self::executePath( $title, $context,
true );
631 $wgTitle = $glob[
'title'];
632 $wgOut = $glob[
'output'];
633 $wgRequest = $glob[
'request'];
634 $wgUser = $glob[
'user'];
635 $wgLang = $glob[
'language'];
636 $main->setTitle( $ctx[
'title'] );
637 $main->setOutput( $ctx[
'output'] );
638 $main->setRequest( $ctx[
'request'] );
639 $main->setUser( $ctx[
'user'] );
640 $main->setLanguage( $ctx[
'language'] );
654 $aliases = $wgContLang->getSpecialPageAliases();
655 $aliasList = self::getAliasList();
661 $caseFoldedAlias = $wgContLang->caseFold( $alias );
662 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
663 if ( isset( $aliasList[$caseFoldedAlias] ) &&
664 $aliasList[$caseFoldedAlias] === $name
672 wfWarn(
"Did not find a usable alias for special page '$name'. " .
673 "It seems all defined aliases conflict?" );
679 if ( strcasecmp( $name, $n ) === 0 ) {
680 wfWarn(
"Found alias defined for $n when searching for " .
681 "special page aliases for $name. Case mismatch?" );
682 return self::getLocalNameFor( $n, $subpage );
687 wfWarn(
"Did not find alias for special page '$name'. " .
688 "Perhaps no aliases are defined for it?" );
691 if ( $subpage !==
false && !is_null( $subpage ) ) {
692 $name =
"$name/$subpage";
695 return $wgContLang->ucfirst( $name );
705 list(
$name, $subpage ) = self::resolveAlias( $alias );
706 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.
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name.
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
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.
Represents a title within MediaWiki.
when a variable name is used in a it is silently declared as a new local masking the global
static executePath(Title &$title, IContextSource &$context, $including=false)
Execute a special page path.
$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)
static capturePath(Title $title, IContextSource $context)
Just like executePath() but will override global variables and execute the page in "inclusion" mode...
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.
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
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.
if(is_null($wgLocalTZoffset)) if(!$wgDBerrorLogTZ) $wgRequest
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