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',
198 self::$aliases =
null;
199 self::$pageObjectCache = [];
209 return array_keys( self::getPageList() );
234 if ( !is_array( self::$list ) ) {
239 self::$list[
'Search'] =
'SpecialSearch';
243 self::$list[
'Confirmemail'] =
'EmailConfirmation';
244 self::$list[
'Invalidateemail'] =
'EmailInvalidation';
248 self::$list[
'ChangeEmail'] =
'SpecialChangeEmail';
252 self::$list[
'JavaScriptTest'] =
'SpecialJavaScriptTest';
256 self::$list[
'PageLanguage'] =
'SpecialPageLanguage';
259 self::$list[
'ChangeContentModel'] =
'SpecialChangeContentModel';
262 self::$list[
'Activeusers'] =
'SpecialActiveUsers';
269 Hooks::run(
'SpecialPage_initList', [ &self::$list ] );
283 if ( is_null( self::$aliases ) ) {
292 foreach ( $pageList
as $name => $stuff ) {
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]
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 ];
371 return isset( $specialPageList[
$title] );
383 if ( isset( self::$pageObjectCache[$realName] ) ) {
384 return self::$pageObjectCache[$realName];
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' );
403 $page = ObjectFactory::getObjectFromSpec( [
404 'class' => $className,
406 'closure_expansion' =>
false,
414 self::$pageObjectCache[$realName] =
$page;
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] ) ) {
528 $context->getOutput()->setArticleRelated(
false );
529 $context->getOutput()->setRobotPolicy(
'noindex,nofollow' );
533 $context->getOutput()->setStatusCode( 404 );
536 $context->getOutput()->showErrorPage(
'nosuchspecialpage',
'nospecialpagetext' );
543 $trxLimits =
$context->getConfig()->get(
'TrxProfilerLimits' );
545 if (
$context->getRequest()->wasPosted() && !
$page->doesWrites() ) {
546 $trxProfiler->setExpectations( $trxLimits[
'POST-nonwrite'], __METHOD__ );
564 $context->getOutput()->redirect( $url );
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() );
624 $main->setRequest(
$context->getRequest() );
625 $main->setUser(
$context->getUser() );
626 $main->setLanguage(
$context->getLanguage() );
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'] );
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?" );
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";
707 if (
$name !=
null ) {
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
$wgSend404Code
Some web hosts attempt to rewrite all responses with a 404 (not found) status code,...
$wgEnableJavaScriptTest
Allow running of javascript test suites via [[Special:JavaScriptTest]] (such as QUnit).
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
$wgDisableInternalSearch
Disable the internal MySQL-based search, to allow it to be implemented by an extension instead.
$wgEmailAuthentication
Require email authentication before sending mail to an email address.
$wgContentHandlerUseDB
Set to false to disable use of the database fields introduced by the ContentHandler facility.
$wgSpecialPages
Special page list.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfLogWarning( $msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
if(is_null($wgLocalTZoffset)) if(! $wgDBerrorLogTZ) $wgRequest
if(! $wgRequest->checkUrlExtension()) if(isset($_SERVER[ 'PATH_INFO']) &&$_SERVER[ 'PATH_INFO'] !='') if(! $wgEnableAPI) $wgTitle
getLanguage()
Get the Language object.
static instance()
Singleton.
static getMain()
Static methods.
Factory for handling the special page list and generating SpecialPage objects.
static getRegularPages()
Return categorised listable special pages for all users.
static $coreList
List of special page names to the subclass of SpecialPage which handles them.
static getPageList()
Get the special page list as an array.
static getLocalNameFor( $name, $subpage=false)
Get the local name for a specified canonical name.
static exists( $name)
Check if a given name exist as a special page or as a special page alias.
static getTitleForAlias( $alias)
Get a title for a given alias.
static getUsablePages(User $user=null)
Return categorised listable special pages which are available for the current user,...
static getList()
Get the special page list as an array.
static getPage( $name)
Find the object with a given name and return it (or NULL)
static resetList()
Reset the internal list of special pages.
static getAliasList()
Initialise and return the list of special page aliases.
static getNames()
Returns a list of canonical special page names.
static executePath(Title &$title, IContextSource &$context, $including=false)
Execute a special page path.
static getRestrictedPages(User $user=null)
Return categorised listable special pages which are available for the current user,...
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
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.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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
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
when a variable name is used in a it is silently declared as a new local masking the global
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
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
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
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
namespace and then decline to actually register it file or subcat img or subcat $title
Allows to change the fields on the form that will be generated $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
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
Interface for objects which can provide a MediaWiki context on request.