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',
145 'GoToInterwiki' =>
'SpecialGoToInterwiki',
148 'Mostlinkedcategories' =>
'MostlinkedCategoriesPage',
149 'Mostimages' =>
'MostimagesPage',
150 'Mostinterwikis' =>
'MostinterwikisPage',
151 'Mostlinked' =>
'MostlinkedPage',
152 'Mostlinkedtemplates' =>
'MostlinkedTemplatesPage',
153 'Mostcategories' =>
'MostcategoriesPage',
154 'Mostrevisions' =>
'MostrevisionsPage',
157 'ComparePages' =>
'SpecialComparePages',
158 'Export' =>
'SpecialExport',
159 'Import' =>
'SpecialImport',
160 'Undelete' =>
'SpecialUndelete',
161 'Whatlinkshere' =>
'SpecialWhatLinksHere',
162 'MergeHistory' =>
'SpecialMergeHistory',
163 'ExpandTemplates' =>
'SpecialExpandTemplates',
166 'Booksources' =>
'SpecialBookSources',
169 'ApiHelp' =>
'SpecialApiHelp',
170 'Blankpage' =>
'SpecialBlankpage',
171 'Diff' =>
'SpecialDiff',
172 'EditTags' =>
'SpecialEditTags',
173 'Emailuser' =>
'SpecialEmailUser',
174 'Movepage' =>
'MovePageForm',
175 'Mycontributions' =>
'SpecialMycontributions',
176 'MyLanguage' =>
'SpecialMyLanguage',
177 'Mypage' =>
'SpecialMypage',
178 'Mytalk' =>
'SpecialMytalk',
179 'Myuploads' =>
'SpecialMyuploads',
180 'AllMyUploads' =>
'SpecialAllMyUploads',
181 'PermanentLink' =>
'SpecialPermanentLink',
182 'Redirect' =>
'SpecialRedirect',
183 'Revisiondelete' =>
'SpecialRevisionDelete',
184 'RunJobs' =>
'SpecialRunJobs',
185 'Specialpages' =>
'SpecialSpecialpages',
188 private static $list;
198 self::$aliases = null;
199 self::$pageObjectCache = [];
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';
262 self::$list[
'Activeusers'] =
'SpecialActiveUsers';
265 self::$list = array_merge( self::$list, $wgSpecialPages );
269 Hooks::run(
'SpecialPage_initList', [ &self::$list ] );
283 if ( is_null( self::$aliases ) ) {
285 $aliases = $wgContLang->getSpecialPageAliases();
286 $pageList = self::getPageList();
292 foreach ( $pageList
as $name => $stuff ) {
293 $caseFoldedAlias = $wgContLang->caseFold(
$name );
294 self::$aliases[$caseFoldedAlias] =
$name;
295 $keepAlias[$caseFoldedAlias] =
'canonical';
300 foreach (
$aliases as $realName => $aliasList ) {
301 $aliasList = array_values( $aliasList );
302 foreach ( $aliasList
as $i => $alias ) {
303 $caseFoldedAlias = $wgContLang->caseFold( $alias );
305 if ( isset( self::$aliases[$caseFoldedAlias] ) &&
306 $realName === self::$aliases[$caseFoldedAlias]
312 if ( !isset( $keepAlias[$caseFoldedAlias] ) ) {
313 self::$aliases[$caseFoldedAlias] = $realName;
315 $keepAlias[$caseFoldedAlias] =
'first';
318 wfWarn(
"First alias '$alias' for $realName conflicts with " .
319 "{$keepAlias[$caseFoldedAlias]} alias for " .
320 self::$aliases[$caseFoldedAlias]
328 return self::$aliases;
341 $bits = explode(
'/', $alias, 2 );
343 $caseFoldedAlias = $wgContLang->caseFold( $bits[0] );
344 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
346 if ( isset(
$aliases[$caseFoldedAlias] ) ) {
349 return [ null, null ];
352 if ( !isset( $bits[1] ) ) {
358 return [
$name, $par ];
370 $specialPageList = self::getPageList();
371 return isset( $specialPageList[
$title] );
381 list( $realName, ) = self::resolveAlias(
$name );
383 if ( isset( self::$pageObjectCache[$realName] ) ) {
384 return self::$pageObjectCache[$realName];
387 $specialPageList = self::getPageList();
389 if ( isset( $specialPageList[$realName] ) ) {
390 $rec = $specialPageList[$realName];
392 if ( is_callable( $rec ) ) {
394 $page = call_user_func( $rec );
395 } elseif ( is_string( $rec ) ) {
397 $page =
new $className;
398 } elseif ( is_array( $rec ) ) {
399 $className = array_shift( $rec );
401 wfDeprecated(
"Array syntax for \$wgSpecialPages is deprecated ($className), " .
402 "define a subclass of SpecialPage instead.",
'1.18' );
404 'class' => $className,
406 'closure_expansion' =>
false,
414 self::$pageObjectCache[$realName] =
$page;
415 if (
$page instanceof SpecialPage ) {
420 wfLogWarning(
"Cannot instantiate special page $realName: bad spec!" );
439 if (
$user === null ) {
443 foreach ( self::getPageList()
as $name => $rec ) {
447 if (
$page->isListed()
465 foreach ( self::getPageList()
as $name => $rec ) {
467 if (
$page->isListed() && !
$page->isRestricted() ) {
484 if (
$user === null ) {
488 foreach ( self::getPageList()
as $name => $rec ) {
492 &&
$page->isRestricted()
518 $bits = explode(
'/', $title->
getDBkey(), 2 );
520 if ( !isset( $bits[1] ) ) {
526 $page = self::getPage( $name );
528 $context->
getOutput()->setArticleRelated(
false );
529 $context->
getOutput()->setRobotPolicy(
'noindex,nofollow' );
532 if ( $wgSend404Code ) {
533 $context->
getOutput()->setStatusCode( 404 );
536 $context->
getOutput()->showErrorPage(
'nosuchspecialpage',
'nospecialpagetext' );
543 $trxLimits = $context->
getConfig()->get(
'TrxProfilerLimits' );
546 $trxProfiler->setExpectations( $trxLimits[
'POST-nonwrite'], __METHOD__ );
551 $page->setContext( $context );
559 if ( $name !=
$page->getLocalName() && !$context->
getRequest()->wasPosted() ) {
562 $title =
$page->getPageTitle( $par );
568 $context->setTitle(
$page->getPageTitle( $par ) );
570 } elseif ( !
$page->isIncludable() ) {
574 $page->including( $including );
609 'title' => $main->getTitle(),
610 'output' => $main->getOutput(),
611 'request' => $main->getRequest(),
612 'user' => $main->getUser(),
613 'language' => $main->getLanguage(),
622 $main->setTitle( $title );
623 $main->setOutput( $context->
getOutput() );
625 $main->setUser( $context->
getUser() );
629 $ret = self::executePath( $title, $context,
true );
632 $wgTitle = $glob[
'title'];
633 $wgOut = $glob[
'output'];
634 $wgRequest = $glob[
'request'];
635 $wgUser = $glob[
'user'];
636 $wgLang = $glob[
'language'];
637 $main->setTitle( $ctx[
'title'] );
638 $main->setOutput( $ctx[
'output'] );
639 $main->setRequest( $ctx[
'request'] );
640 $main->setUser( $ctx[
'user'] );
641 $main->setLanguage( $ctx[
'language'] );
655 $aliases = $wgContLang->getSpecialPageAliases();
656 $aliasList = self::getAliasList();
662 $caseFoldedAlias = $wgContLang->caseFold( $alias );
663 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
664 if ( isset( $aliasList[$caseFoldedAlias] ) &&
665 $aliasList[$caseFoldedAlias] === $name
673 wfWarn(
"Did not find a usable alias for special page '$name'. " .
674 "It seems all defined aliases conflict?" );
680 if ( strcasecmp( $name, $n ) === 0 ) {
681 wfWarn(
"Found alias defined for $n when searching for " .
682 "special page aliases for $name. Case mismatch?" );
683 return self::getLocalNameFor( $n, $subpage );
688 wfWarn(
"Did not find alias for special page '$name'. " .
689 "Perhaps no aliases are defined for it?" );
692 if ( $subpage !==
false && !is_null( $subpage ) ) {
693 $name =
"$name/$subpage";
696 return $wgContLang->ucfirst( $name );
706 list(
$name, $subpage ) = self::resolveAlias( $alias );
707 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