Go to the documentation of this file.
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' =>
'LoginForm',
86 'CreateAccount' =>
'SpecialCreateAccount',
89 'Block' =>
'SpecialBlock',
90 'Unblock' =>
'SpecialUnblock',
91 'BlockList' =>
'SpecialBlockList',
92 'ChangePassword' =>
'SpecialChangePassword',
93 'PasswordReset' =>
'SpecialPasswordReset',
94 'DeletedContributions' =>
'DeletedContributionsPage',
95 'Preferences' =>
'SpecialPreferences',
96 'ResetTokens' =>
'SpecialResetTokens',
97 'Contributions' =>
'SpecialContributions',
98 'Listgrouprights' =>
'SpecialListGroupRights',
99 'Listusers' =>
'SpecialListUsers',
100 'Listadmins' =>
'SpecialListAdmins',
101 'Listbots' =>
'SpecialListBots',
102 'Userrights' =>
'UserrightsPage',
103 'EditWatchlist' =>
'SpecialEditWatchlist',
106 'Newimages' =>
'SpecialNewFiles',
107 'Log' =>
'SpecialLog',
108 'Watchlist' =>
'SpecialWatchlist',
109 'Newpages' =>
'SpecialNewpages',
110 'Recentchanges' =>
'SpecialRecentChanges',
111 'Recentchangeslinked' =>
'SpecialRecentChangesLinked',
112 'Tags' =>
'SpecialTags',
115 'Listfiles' =>
'SpecialListFiles',
116 'Filepath' =>
'SpecialFilepath',
117 'MIMEsearch' =>
'MIMEsearchPage',
118 'FileDuplicateSearch' =>
'FileDuplicateSearchPage',
119 'Upload' =>
'SpecialUpload',
120 'UploadStash' =>
'SpecialUploadStash',
121 'ListDuplicatedFiles' =>
'ListDuplicatedFilesPage',
124 'Statistics' =>
'SpecialStatistics',
125 'Allmessages' =>
'SpecialAllmessages',
126 'Version' =>
'SpecialVersion',
127 'Lockdb' =>
'SpecialLockdb',
128 'Unlockdb' =>
'SpecialUnlockdb',
131 'LinkSearch' =>
'LinkSearchPage',
132 'Randompage' =>
'RandomPage',
133 'RandomInCategory' =>
'SpecialRandomInCategory',
134 'Randomredirect' =>
'SpecialRandomredirect',
137 'Mostlinkedcategories' =>
'MostlinkedCategoriesPage',
138 'Mostimages' =>
'MostimagesPage',
139 'Mostinterwikis' =>
'MostinterwikisPage',
140 'Mostlinked' =>
'MostlinkedPage',
141 'Mostlinkedtemplates' =>
'MostlinkedTemplatesPage',
142 'Mostcategories' =>
'MostcategoriesPage',
143 'Mostrevisions' =>
'MostrevisionsPage',
146 'ComparePages' =>
'SpecialComparePages',
147 'Export' =>
'SpecialExport',
148 'Import' =>
'SpecialImport',
149 'Undelete' =>
'SpecialUndelete',
150 'Whatlinkshere' =>
'SpecialWhatLinksHere',
151 'MergeHistory' =>
'SpecialMergeHistory',
152 'ExpandTemplates' =>
'SpecialExpandTemplates',
155 'Booksources' =>
'SpecialBookSources',
158 'Blankpage' =>
'SpecialBlankpage',
159 'Diff' =>
'SpecialDiff',
160 'Emailuser' =>
'SpecialEmailUser',
161 'Movepage' =>
'MovePageForm',
162 'Mycontributions' =>
'SpecialMycontributions',
163 'Mypage' =>
'SpecialMypage',
164 'Mytalk' =>
'SpecialMytalk',
165 'Myuploads' =>
'SpecialMyuploads',
166 'AllMyUploads' =>
'SpecialAllMyUploads',
167 'PermanentLink' =>
'SpecialPermanentLink',
168 'Redirect' =>
'SpecialRedirect',
169 'Revisiondelete' =>
'SpecialRevisionDelete',
170 'RunJobs' =>
'SpecialRunJobs',
171 'Specialpages' =>
'SpecialSpecialpages',
172 'Userlogout' =>
'SpecialUserlogout',
184 global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
185 global $wgEnableEmail, $wgEnableJavaScriptTest;
187 if ( !is_object( self::$list ) ) {
190 if ( !$wgDisableCounters ) {
191 self::$list[
'Popularpages'] =
'PopularPagesPage';
194 if ( !$wgDisableInternalSearch ) {
195 self::$list[
'Search'] =
'SpecialSearch';
198 if ( $wgEmailAuthentication ) {
199 self::$list[
'Confirmemail'] =
'EmailConfirmation';
200 self::$list[
'Invalidateemail'] =
'EmailInvalidation';
203 if ( $wgEnableEmail ) {
204 self::$list[
'ChangeEmail'] =
'SpecialChangeEmail';
207 if ( $wgEnableJavaScriptTest ) {
208 self::$list[
'JavaScriptTest'] =
'SpecialJavaScriptTest';
211 self::$list[
'Activeusers'] =
'SpecialActiveUsers';
214 self::$list = array_merge( self::$list, $wgSpecialPages );
221 settype( self::$list,
'object' );
238 if ( !is_object( self::$aliases ) ) {
245 self::$aliases =
array();
246 foreach (
$aliases as $realName => $aliasList ) {
247 foreach ( $aliasList
as $alias ) {
248 self::$aliases[
$wgContLang->caseFold( $alias )] = $realName;
250 unset( $missingPages->$realName );
252 foreach ( $missingPages
as $name => $stuff ) {
257 self::$aliases = (
object)self::$aliases;
273 $bits = explode(
'/', $alias, 2 );
275 $caseFoldedAlias =
$wgContLang->caseFold( $bits[0] );
276 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
277 if ( isset( self::getAliasList()->$caseFoldedAlias ) ) {
280 return array(
null,
null );
283 if ( !isset( $bits[1] ) ) {
302 global $wgSpecialPageGroups;
303 $name = is_object( $page ) ? $page->getName() : $page;
304 $wgSpecialPageGroups[
$name] = $group;
317 return $page->getFinalGroupName();
329 return property_exists( self::getList(),
$title );
340 if ( property_exists( self::getList(), $realName ) ) {
342 if ( is_string( $rec ) ) {
345 return new $className;
346 } elseif ( is_array( $rec ) ) {
348 wfDebug(
"Array syntax for \$wgSpecialPages is deprecated, " .
349 "define a subclass of SpecialPage instead." );
350 $className = array_shift( $rec );
370 if (
$user ===
null ) {
374 foreach ( self::getList()
as $name => $rec ) {
378 if ( $page->isListed()
379 && ( !$page->isRestricted() || $page->userCanExecute(
$user ) )
381 $pages[
$name] = $page;
396 foreach ( self::getList()
as $name => $rec ) {
398 if ( $page->isListed() && !$page->isRestricted() ) {
399 $pages[
$name] = $page;
415 foreach ( self::getList()
as $name => $rec ) {
419 && $page->isRestricted()
420 && $page->userCanExecute(
$wgUser )
422 $pages[
$name] = $page;
447 $bits = explode(
'/',
$title->getDBkey(), 2 );
449 if ( !isset( $bits[1] ) ) {
457 $context->
getOutput()->setArticleRelated(
false );
458 $context->
getOutput()->setRobotPolicy(
'noindex,nofollow' );
461 if ( $wgSend404Code ) {
462 $context->
getOutput()->setStatusCode( 404 );
465 $context->
getOutput()->showErrorPage(
'nosuchspecialpage',
'nospecialpagetext' );
472 $page->setContext( $context );
480 if (
$name != $page->getLocalName() && !$context->
getRequest()->wasPosted() ) {
483 $title = $page->getPageTitle( $par );
490 $context->setTitle( $page->getPageTitle( $par ) );
492 } elseif ( !$page->isIncludable() ) {
498 $page->including( $including );
501 $profName =
'Special:' . $page->getName();
530 $oldRequest = $wgRequest;
547 $wgRequest = $oldRequest;
571 if ( strcasecmp(
$name,
$n ) === 0 ) {
572 wfWarn(
"Found alias defined for $n when searching for " .
573 "special page aliases for $name. Case mismatch?" );
580 wfWarn(
"Did not find alias for special page '$name'. " .
581 "Perhaps no aliases are defined for it?" );
584 if ( $subpage !==
false && !is_null( $subpage ) ) {
585 $name =
"$name/$subpage";
static getList()
Get the special page list.
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest object
Factory for handling the special page list and generating SpecialPage objects.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static $list
List of special page names to the subclass of SpecialPage which handles them.
wfProfileIn( $functionname)
Begin profiling of a function.
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 getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
static getRestrictedPages()
Return categorised listable special pages which are available for the current user,...
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 content language as $wgContLang
static executePath(Title &$title, IContextSource &$context, $including=false)
Execute a special page path.
static getUsablePages(User $user=null)
Return categorised listable special pages which are available for the current user,...
static getGroup(&$page)
Get the group that the special page belongs in on Special:SpecialPage.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
static exists( $name)
Check if a given name exist as a special page or as a special page alias.
when a variable name is used in a it is silently declared as a new masking the global
static getRegularPages()
Return categorised listable special pages for all users.
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 newObj( $class, $args=array())
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
presenting them properly to the user as errors is done by the caller $title
Allows to change the fields on the form that will be generated $name
static setGroup( $page, $group)
Add a page to a certain display group for Special:SpecialPages.
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
static getTitleForAlias( $alias)
Get a title for a given alias.
static getLocalNameFor( $name, $subpage=false)
Get the local name for a specified canonical name.
getUser()
Get the User object.
static capturePath(Title $title, IContextSource $context)
Just like executePath() but will override global variables and execute the page in "inclusion" mode.
static getMain()
Static methods.
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 account $user
Interface for objects which can provide a context on request.
Represents a title within MediaWiki.
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
getRequest()
Get the WebRequest object.
static getAliasList()
Initialise and return the list of special page aliases.
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 getPage( $name)
Find the object with a given name and return it (or NULL)
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getOutput()
Get the OutputPage object.
getLanguage()
Get the Language object.
if(! $wgRequest->checkUrlExtension()) if(! $wgEnableAPI) $wgTitle