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 'AutoblockList' =>
'SpecialAutoblockList',
100 'ChangePassword' =>
'SpecialChangePassword',
101 'BotPasswords' =>
'SpecialBotPasswords',
102 'PasswordReset' =>
'SpecialPasswordReset',
103 'DeletedContributions' =>
'DeletedContributionsPage',
104 'Preferences' =>
'SpecialPreferences',
105 'ResetTokens' =>
'SpecialResetTokens',
106 'Contributions' =>
'SpecialContributions',
107 'Listgrouprights' =>
'SpecialListGroupRights',
108 'Listgrants' =>
'SpecialListGrants',
109 'Listusers' =>
'SpecialListUsers',
110 'Listadmins' =>
'SpecialListAdmins',
111 'Listbots' =>
'SpecialListBots',
112 'Userrights' =>
'UserrightsPage',
113 'EditWatchlist' =>
'SpecialEditWatchlist',
116 'Newimages' =>
'SpecialNewFiles',
117 'Log' =>
'SpecialLog',
118 'Watchlist' =>
'SpecialWatchlist',
119 'Newpages' =>
'SpecialNewpages',
120 'Recentchanges' =>
'SpecialRecentChanges',
121 'Recentchangeslinked' =>
'SpecialRecentChangesLinked',
122 'Tags' =>
'SpecialTags',
125 'Listfiles' =>
'SpecialListFiles',
126 'Filepath' =>
'SpecialFilepath',
127 'MediaStatistics' =>
'MediaStatisticsPage',
128 'MIMEsearch' =>
'MIMEsearchPage',
129 'FileDuplicateSearch' =>
'FileDuplicateSearchPage',
130 'Upload' =>
'SpecialUpload',
131 'UploadStash' =>
'SpecialUploadStash',
132 'ListDuplicatedFiles' =>
'ListDuplicatedFilesPage',
135 'ApiSandbox' =>
'SpecialApiSandbox',
136 'Statistics' =>
'SpecialStatistics',
137 'Allmessages' =>
'SpecialAllMessages',
138 'Version' =>
'SpecialVersion',
139 'Lockdb' =>
'SpecialLockdb',
140 'Unlockdb' =>
'SpecialUnlockdb',
143 'LinkSearch' =>
'LinkSearchPage',
144 'Randompage' =>
'RandomPage',
145 'RandomInCategory' =>
'SpecialRandomInCategory',
146 'Randomredirect' =>
'SpecialRandomredirect',
147 'Randomrootpage' =>
'SpecialRandomrootpage',
148 'GoToInterwiki' =>
'SpecialGoToInterwiki',
151 'Mostlinkedcategories' =>
'MostlinkedCategoriesPage',
152 'Mostimages' =>
'MostimagesPage',
153 'Mostinterwikis' =>
'MostinterwikisPage',
154 'Mostlinked' =>
'MostlinkedPage',
155 'Mostlinkedtemplates' =>
'MostlinkedTemplatesPage',
156 'Mostcategories' =>
'MostcategoriesPage',
157 'Mostrevisions' =>
'MostrevisionsPage',
160 'ComparePages' =>
'SpecialComparePages',
161 'Export' =>
'SpecialExport',
162 'Import' =>
'SpecialImport',
163 'Undelete' =>
'SpecialUndelete',
164 'Whatlinkshere' =>
'SpecialWhatLinksHere',
165 'MergeHistory' =>
'SpecialMergeHistory',
166 'ExpandTemplates' =>
'SpecialExpandTemplates',
169 'Booksources' =>
'SpecialBookSources',
172 'ApiHelp' =>
'SpecialApiHelp',
173 'Blankpage' =>
'SpecialBlankpage',
174 'Diff' =>
'SpecialDiff',
175 'EditTags' =>
'SpecialEditTags',
176 'Emailuser' =>
'SpecialEmailUser',
177 'Movepage' =>
'MovePageForm',
178 'Mycontributions' =>
'SpecialMycontributions',
179 'MyLanguage' =>
'SpecialMyLanguage',
180 'Mypage' =>
'SpecialMypage',
181 'Mytalk' =>
'SpecialMytalk',
182 'Myuploads' =>
'SpecialMyuploads',
183 'AllMyUploads' =>
'SpecialAllMyUploads',
184 'PermanentLink' =>
'SpecialPermanentLink',
185 'Redirect' =>
'SpecialRedirect',
186 'Revisiondelete' =>
'SpecialRevisionDelete',
187 'RunJobs' =>
'SpecialRunJobs',
188 'Specialpages' =>
'SpecialSpecialpages',
189 'PageData' =>
'SpecialPageData'
201 self::$aliases =
null;
211 return array_keys( self::getPageList() );
236 if ( !is_array( self::$list ) ) {
240 self::$list[
'Search'] =
'SpecialSearch';
244 self::$list[
'Confirmemail'] =
'EmailConfirmation';
245 self::$list[
'Invalidateemail'] =
'EmailInvalidation';
249 self::$list[
'ChangeEmail'] =
'SpecialChangeEmail';
253 self::$list[
'JavaScriptTest'] =
'SpecialJavaScriptTest';
257 self::$list[
'PageLanguage'] =
'SpecialPageLanguage';
260 self::$list[
'ChangeContentModel'] =
'SpecialChangeContentModel';
268 Hooks::run(
'SpecialPage_initList', [ &self::$list ] );
282 if ( is_null( self::$aliases ) ) {
291 foreach ( $pageList
as $name => $stuff ) {
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]
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 ];
370 return isset( $specialPageList[
$title] );
384 if ( isset( $specialPageList[$realName] ) ) {
385 $rec = $specialPageList[$realName];
387 if ( is_callable( $rec ) ) {
389 $page = call_user_func( $rec );
390 } elseif ( is_string( $rec ) ) {
392 $page =
new $className;
393 } elseif ( is_array( $rec ) ) {
394 $className = array_shift( $rec );
396 wfDeprecated(
"Array syntax for \$wgSpecialPages is deprecated ($className), " .
397 "define a subclass of SpecialPage instead.",
'1.18' );
398 $page = ObjectFactory::getObjectFromSpec( [
399 'class' => $className,
401 'closure_expansion' =>
false,
414 wfLogWarning(
"Cannot instantiate special page $realName: bad spec!" );
433 if (
$user ===
null ) {
437 foreach ( self::getPageList()
as $name => $rec ) {
441 if ( $page->isListed()
442 && ( !$page->isRestricted() || $page->userCanExecute(
$user ) )
444 $pages[
$name] = $page;
459 foreach ( self::getPageList()
as $name => $rec ) {
461 if ( $page && $page->isListed() && !$page->isRestricted() ) {
462 $pages[
$name] = $page;
478 if (
$user ===
null ) {
482 foreach ( self::getPageList()
as $name => $rec ) {
486 && $page->isRestricted()
487 && $page->userCanExecute(
$user )
489 $pages[
$name] = $page;
515 $bits = explode(
'/',
$title->getDBkey(), 2 );
517 if ( !isset( $bits[1] ) ) {
525 $context->getOutput()->setArticleRelated(
false );
526 $context->getOutput()->setRobotPolicy(
'noindex,nofollow' );
530 $context->getOutput()->setStatusCode( 404 );
533 $context->getOutput()->showErrorPage(
'nosuchspecialpage',
'nospecialpagetext' );
540 $trxLimits =
$context->getConfig()->get(
'TrxProfilerLimits' );
541 $trxProfiler = Profiler::instance()->getTransactionProfiler();
542 if (
$context->getRequest()->wasPosted() && !$page->doesWrites() ) {
543 $trxProfiler->setExpectations( $trxLimits[
'POST-nonwrite'], __METHOD__ );
544 $context->getRequest()->markAsSafeRequest();
557 if (
$name != $page->getLocalName() && !
$context->getRequest()->wasPosted() ) {
560 $title = $page->getPageTitle( $par );
562 $context->getOutput()->redirect( $url );
566 $context->setTitle( $page->getPageTitle( $par ) );
568 } elseif ( !$page->isIncludable() ) {
572 $page->including( $including );
613 'title' => $main->getTitle(),
614 'output' => $main->getOutput(),
615 'request' => $main->getRequest(),
616 'user' => $main->getUser(),
617 'language' => $main->getLanguage(),
626 $main->setTitle(
$title );
627 $main->setOutput(
$context->getOutput() );
628 $main->setRequest(
$context->getRequest() );
629 $main->setUser(
$context->getUser() );
630 $main->setLanguage(
$context->getLanguage() );
641 $main->setTitle( $ctx[
'title'] );
642 $main->setOutput( $ctx[
'output'] );
643 $main->setRequest( $ctx[
'request'] );
644 $main->setUser( $ctx[
'user'] );
645 $main->setLanguage( $ctx[
'language'] );
666 $caseFoldedAlias =
$wgContLang->caseFold( $alias );
667 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
668 if ( isset( $aliasList[$caseFoldedAlias] ) &&
669 $aliasList[$caseFoldedAlias] ===
$name
677 wfWarn(
"Did not find a usable alias for special page '$name'. " .
678 "It seems all defined aliases conflict?" );
684 if ( strcasecmp(
$name, $n ) === 0 ) {
685 wfWarn(
"Found alias defined for $n when searching for " .
686 "special page aliases for $name. Case mismatch?" );
692 wfWarn(
"Did not find alias for special page '$name'. " .
693 "Perhaps no aliases are defined for it?" );
696 if ( $subpage !==
false && !is_null( $subpage ) ) {
698 $subpage = str_replace(
' ',
'_', $subpage );
699 $name =
"$name/$subpage";
713 if (
$name !=
null ) {
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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(! $wgDBerrorLogTZ) $wgRequest
if(! $wgRequest->checkUrlExtension()) if(isset($_SERVER[ 'PATH_INFO']) &&$_SERVER[ 'PATH_INFO'] !='') if(! $wgEnableAPI) $wgTitle
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 capturePath(Title $title, IContextSource $context, LinkRenderer $linkRenderer=null)
Just like executePath() but will override global variables and execute the page in "inclusion" mode.
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 executePath(Title &$title, IContextSource &$context, $including=false, LinkRenderer $linkRenderer=null)
Execute a special page path.
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 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...
Parent class for all special pages.
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,...
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
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 and they can depend only on the ResourceLoaderContext $context
namespace and then decline to actually register it file or subcat img or subcat $title
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
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
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
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
Interface for objects which can provide a MediaWiki context on request.