MediaWiki REL1_31
SpecialPageFactory.php
Go to the documentation of this file.
1<?php
25use Wikimedia\ObjectFactory;
26
52 private static $coreList = [
53 // Maintenance Reports
54 'BrokenRedirects' => BrokenRedirectsPage::class,
55 'Deadendpages' => DeadendPagesPage::class,
56 'DoubleRedirects' => DoubleRedirectsPage::class,
57 'Longpages' => LongPagesPage::class,
58 'Ancientpages' => AncientPagesPage::class,
59 'Lonelypages' => LonelyPagesPage::class,
60 'Fewestrevisions' => FewestrevisionsPage::class,
61 'Withoutinterwiki' => WithoutInterwikiPage::class,
62 'Protectedpages' => SpecialProtectedpages::class,
63 'Protectedtitles' => SpecialProtectedtitles::class,
64 'Shortpages' => ShortPagesPage::class,
65 'Uncategorizedcategories' => UncategorizedCategoriesPage::class,
66 'Uncategorizedimages' => UncategorizedImagesPage::class,
67 'Uncategorizedpages' => UncategorizedPagesPage::class,
68 'Uncategorizedtemplates' => UncategorizedTemplatesPage::class,
69 'Unusedcategories' => UnusedCategoriesPage::class,
70 'Unusedimages' => UnusedimagesPage::class,
71 'Unusedtemplates' => UnusedtemplatesPage::class,
72 'Unwatchedpages' => UnwatchedpagesPage::class,
73 'Wantedcategories' => WantedCategoriesPage::class,
74 'Wantedfiles' => WantedFilesPage::class,
75 'Wantedpages' => WantedPagesPage::class,
76 'Wantedtemplates' => WantedTemplatesPage::class,
77
78 // List of pages
79 'Allpages' => SpecialAllPages::class,
80 'Prefixindex' => SpecialPrefixindex::class,
81 'Categories' => SpecialCategories::class,
82 'Listredirects' => ListredirectsPage::class,
83 'PagesWithProp' => SpecialPagesWithProp::class,
84 'TrackingCategories' => SpecialTrackingCategories::class,
85
86 // Authentication
87 'Userlogin' => SpecialUserLogin::class,
88 'Userlogout' => SpecialUserLogout::class,
89 'CreateAccount' => SpecialCreateAccount::class,
90 'LinkAccounts' => SpecialLinkAccounts::class,
91 'UnlinkAccounts' => SpecialUnlinkAccounts::class,
92 'ChangeCredentials' => SpecialChangeCredentials::class,
93 'RemoveCredentials' => SpecialRemoveCredentials::class,
94
95 // Users and rights
96 'Activeusers' => SpecialActiveUsers::class,
97 'Block' => SpecialBlock::class,
98 'Unblock' => SpecialUnblock::class,
99 'BlockList' => SpecialBlockList::class,
100 'AutoblockList' => SpecialAutoblockList::class,
101 'ChangePassword' => SpecialChangePassword::class,
102 'BotPasswords' => SpecialBotPasswords::class,
103 'PasswordReset' => SpecialPasswordReset::class,
104 'DeletedContributions' => DeletedContributionsPage::class,
105 'Preferences' => SpecialPreferences::class,
106 'ResetTokens' => SpecialResetTokens::class,
107 'Contributions' => SpecialContributions::class,
108 'Listgrouprights' => SpecialListGroupRights::class,
109 'Listgrants' => SpecialListGrants::class,
110 'Listusers' => SpecialListUsers::class,
111 'Listadmins' => SpecialListAdmins::class,
112 'Listbots' => SpecialListBots::class,
113 'Userrights' => UserrightsPage::class,
114 'EditWatchlist' => SpecialEditWatchlist::class,
115
116 // Recent changes and logs
117 'Newimages' => SpecialNewFiles::class,
118 'Log' => SpecialLog::class,
119 'Watchlist' => SpecialWatchlist::class,
120 'Newpages' => SpecialNewpages::class,
121 'Recentchanges' => SpecialRecentChanges::class,
122 'Recentchangeslinked' => SpecialRecentChangesLinked::class,
123 'Tags' => SpecialTags::class,
124
125 // Media reports and uploads
126 'Listfiles' => SpecialListFiles::class,
127 'Filepath' => SpecialFilepath::class,
128 'MediaStatistics' => MediaStatisticsPage::class,
129 'MIMEsearch' => MIMEsearchPage::class,
130 'FileDuplicateSearch' => FileDuplicateSearchPage::class,
131 'Upload' => SpecialUpload::class,
132 'UploadStash' => SpecialUploadStash::class,
133 'ListDuplicatedFiles' => ListDuplicatedFilesPage::class,
134
135 // Data and tools
136 'ApiSandbox' => SpecialApiSandbox::class,
137 'Statistics' => SpecialStatistics::class,
138 'Allmessages' => SpecialAllMessages::class,
139 'Version' => SpecialVersion::class,
140 'Lockdb' => SpecialLockdb::class,
141 'Unlockdb' => SpecialUnlockdb::class,
142
143 // Redirecting special pages
144 'LinkSearch' => LinkSearchPage::class,
145 'Randompage' => RandomPage::class,
146 'RandomInCategory' => SpecialRandomInCategory::class,
147 'Randomredirect' => SpecialRandomredirect::class,
148 'Randomrootpage' => SpecialRandomrootpage::class,
149 'GoToInterwiki' => SpecialGoToInterwiki::class,
150
151 // High use pages
152 'Mostlinkedcategories' => MostlinkedCategoriesPage::class,
153 'Mostimages' => MostimagesPage::class,
154 'Mostinterwikis' => MostinterwikisPage::class,
155 'Mostlinked' => MostlinkedPage::class,
156 'Mostlinkedtemplates' => MostlinkedTemplatesPage::class,
157 'Mostcategories' => MostcategoriesPage::class,
158 'Mostrevisions' => MostrevisionsPage::class,
159
160 // Page tools
161 'ComparePages' => SpecialComparePages::class,
162 'Export' => SpecialExport::class,
163 'Import' => SpecialImport::class,
164 'Undelete' => SpecialUndelete::class,
165 'Whatlinkshere' => SpecialWhatLinksHere::class,
166 'MergeHistory' => SpecialMergeHistory::class,
167 'ExpandTemplates' => SpecialExpandTemplates::class,
168
169 // Other
170 'Booksources' => SpecialBookSources::class,
171
172 // Unlisted / redirects
173 'ApiHelp' => SpecialApiHelp::class,
174 'Blankpage' => SpecialBlankpage::class,
175 'Diff' => SpecialDiff::class,
176 'EditTags' => SpecialEditTags::class,
177 'Emailuser' => SpecialEmailUser::class,
178 'Movepage' => MovePageForm::class,
179 'Mycontributions' => SpecialMycontributions::class,
180 'MyLanguage' => SpecialMyLanguage::class,
181 'Mypage' => SpecialMypage::class,
182 'Mytalk' => SpecialMytalk::class,
183 'Myuploads' => SpecialMyuploads::class,
184 'AllMyUploads' => SpecialAllMyUploads::class,
185 'PermanentLink' => SpecialPermanentLink::class,
186 'Redirect' => SpecialRedirect::class,
187 'Revisiondelete' => SpecialRevisionDelete::class,
188 'RunJobs' => SpecialRunJobs::class,
189 'Specialpages' => SpecialSpecialpages::class,
190 'PageData' => SpecialPageData::class,
191 ];
192
193 private static $list;
194 private static $aliases;
195
200 public static function resetList() {
201 self::$list = null;
202 self::$aliases = null;
203 }
204
211 public static function getNames() {
212 return array_keys( self::getPageList() );
213 }
214
220 private static function getPageList() {
225
226 if ( !is_array( self::$list ) ) {
227 self::$list = self::$coreList;
228
230 self::$list['Search'] = SpecialSearch::class;
231 }
232
234 self::$list['Confirmemail'] = EmailConfirmation::class;
235 self::$list['Invalidateemail'] = EmailInvalidation::class;
236 }
237
238 if ( $wgEnableEmail ) {
239 self::$list['ChangeEmail'] = SpecialChangeEmail::class;
240 }
241
243 self::$list['JavaScriptTest'] = SpecialJavaScriptTest::class;
244 }
245
246 if ( $wgPageLanguageUseDB ) {
247 self::$list['PageLanguage'] = SpecialPageLanguage::class;
248 }
250 self::$list['ChangeContentModel'] = SpecialChangeContentModel::class;
251 }
252
253 // Add extension special pages
254 self::$list = array_merge( self::$list, $wgSpecialPages );
255
256 // This hook can be used to disable unwanted core special pages
257 // or conditionally register special pages.
258 Hooks::run( 'SpecialPage_initList', [ &self::$list ] );
259
260 }
261
262 return self::$list;
263 }
264
271 private static function getAliasList() {
272 if ( is_null( self::$aliases ) ) {
274 $aliases = $wgContLang->getSpecialPageAliases();
275 $pageList = self::getPageList();
276
277 self::$aliases = [];
278 $keepAlias = [];
279
280 // Force every canonical name to be an alias for itself.
281 foreach ( $pageList as $name => $stuff ) {
282 $caseFoldedAlias = $wgContLang->caseFold( $name );
283 self::$aliases[$caseFoldedAlias] = $name;
284 $keepAlias[$caseFoldedAlias] = 'canonical';
285 }
286
287 // Check for $aliases being an array since Language::getSpecialPageAliases can return null
288 if ( is_array( $aliases ) ) {
289 foreach ( $aliases as $realName => $aliasList ) {
290 $aliasList = array_values( $aliasList );
291 foreach ( $aliasList as $i => $alias ) {
292 $caseFoldedAlias = $wgContLang->caseFold( $alias );
293
294 if ( isset( self::$aliases[$caseFoldedAlias] ) &&
295 $realName === self::$aliases[$caseFoldedAlias]
296 ) {
297 // Ignore same-realName conflicts
298 continue;
299 }
300
301 if ( !isset( $keepAlias[$caseFoldedAlias] ) ) {
302 self::$aliases[$caseFoldedAlias] = $realName;
303 if ( !$i ) {
304 $keepAlias[$caseFoldedAlias] = 'first';
305 }
306 } elseif ( !$i ) {
307 wfWarn( "First alias '$alias' for $realName conflicts with " .
308 "{$keepAlias[$caseFoldedAlias]} alias for " .
309 self::$aliases[$caseFoldedAlias]
310 );
311 }
312 }
313 }
314 }
315 }
316
317 return self::$aliases;
318 }
319
328 public static function resolveAlias( $alias ) {
330 $bits = explode( '/', $alias, 2 );
331
332 $caseFoldedAlias = $wgContLang->caseFold( $bits[0] );
333 $caseFoldedAlias = str_replace( ' ', '_', $caseFoldedAlias );
335 if ( isset( $aliases[$caseFoldedAlias] ) ) {
336 $name = $aliases[$caseFoldedAlias];
337 } else {
338 return [ null, null ];
339 }
340
341 if ( !isset( $bits[1] ) ) { // T4087
342 $par = null;
343 } else {
344 $par = $bits[1];
345 }
346
347 return [ $name, $par ];
348 }
349
356 public static function exists( $name ) {
357 list( $title, /*...*/ ) = self::resolveAlias( $name );
358
359 $specialPageList = self::getPageList();
360 return isset( $specialPageList[$title] );
361 }
362
369 public static function getPage( $name ) {
370 list( $realName, /*...*/ ) = self::resolveAlias( $name );
371
372 $specialPageList = self::getPageList();
373
374 if ( isset( $specialPageList[$realName] ) ) {
375 $rec = $specialPageList[$realName];
376
377 if ( is_callable( $rec ) ) {
378 // Use callback to instantiate the special page
379 $page = call_user_func( $rec );
380 } elseif ( is_string( $rec ) ) {
381 $className = $rec;
382 $page = new $className;
383 } elseif ( is_array( $rec ) ) {
384 $className = array_shift( $rec );
385 // @deprecated, officially since 1.18, unofficially since forever
386 wfDeprecated( "Array syntax for \$wgSpecialPages is deprecated ($className), " .
387 "define a subclass of SpecialPage instead.", '1.18' );
388 $page = ObjectFactory::getObjectFromSpec( [
389 'class' => $className,
390 'args' => $rec,
391 'closure_expansion' => false,
392 ] );
393 } elseif ( $rec instanceof SpecialPage ) {
394 $page = $rec; // XXX: we should deep clone here
395 } else {
396 $page = null;
397 }
398
399 if ( $page instanceof SpecialPage ) {
400 return $page;
401 } else {
402 // It's not a classname, nor a callback, nor a legacy constructor array,
403 // nor a special page object. Give up.
404 wfLogWarning( "Cannot instantiate special page $realName: bad spec!" );
405 return null;
406 }
407
408 } else {
409 return null;
410 }
411 }
412
421 public static function getUsablePages( User $user = null ) {
422 $pages = [];
423 if ( $user === null ) {
425 $user = $wgUser;
426 }
427 foreach ( self::getPageList() as $name => $rec ) {
428 $page = self::getPage( $name );
429 if ( $page ) { // not null
430 $page->setContext( RequestContext::getMain() );
431 if ( $page->isListed()
432 && ( !$page->isRestricted() || $page->userCanExecute( $user ) )
433 ) {
434 $pages[$name] = $page;
435 }
436 }
437 }
438
439 return $pages;
440 }
441
447 public static function getRegularPages() {
448 $pages = [];
449 foreach ( self::getPageList() as $name => $rec ) {
450 $page = self::getPage( $name );
451 if ( $page && $page->isListed() && !$page->isRestricted() ) {
452 $pages[$name] = $page;
453 }
454 }
455
456 return $pages;
457 }
458
466 public static function getRestrictedPages( User $user = null ) {
467 $pages = [];
468 if ( $user === null ) {
470 $user = $wgUser;
471 }
472 foreach ( self::getPageList() as $name => $rec ) {
473 $page = self::getPage( $name );
474 if ( $page
475 && $page->isListed()
476 && $page->isRestricted()
477 && $page->userCanExecute( $user )
478 ) {
479 $pages[$name] = $page;
480 }
481 }
482
483 return $pages;
484 }
485
501 public static function executePath( Title &$title, IContextSource &$context, $including = false,
503 ) {
504 // @todo FIXME: Redirects broken due to this call
505 $bits = explode( '/', $title->getDBkey(), 2 );
506 $name = $bits[0];
507 if ( !isset( $bits[1] ) ) { // T4087
508 $par = null;
509 } else {
510 $par = $bits[1];
511 }
512
513 $page = self::getPage( $name );
514 if ( !$page ) {
515 $context->getOutput()->setArticleRelated( false );
516 $context->getOutput()->setRobotPolicy( 'noindex,nofollow' );
517
519 if ( $wgSend404Code ) {
520 $context->getOutput()->setStatusCode( 404 );
521 }
522
523 $context->getOutput()->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
524
525 return false;
526 }
527
528 if ( !$including ) {
529 // Narrow DB query expectations for this HTTP request
530 $trxLimits = $context->getConfig()->get( 'TrxProfilerLimits' );
531 $trxProfiler = Profiler::instance()->getTransactionProfiler();
532 if ( $context->getRequest()->wasPosted() && !$page->doesWrites() ) {
533 $trxProfiler->setExpectations( $trxLimits['POST-nonwrite'], __METHOD__ );
534 $context->getRequest()->markAsSafeRequest();
535 }
536 }
537
538 // Page exists, set the context
539 $page->setContext( $context );
540
541 if ( !$including ) {
542 // Redirect to canonical alias for GET commands
543 // Not for POST, we'd lose the post data, so it's best to just distribute
544 // the request. Such POST requests are possible for old extensions that
545 // generate self-links without being aware that their default name has
546 // changed.
547 if ( $name != $page->getLocalName() && !$context->getRequest()->wasPosted() ) {
548 $query = $context->getRequest()->getQueryValues();
549 unset( $query['title'] );
550 $title = $page->getPageTitle( $par );
551 $url = $title->getFullURL( $query );
552 $context->getOutput()->redirect( $url );
553
554 return $title;
555 } else {
556 $context->setTitle( $page->getPageTitle( $par ) );
557 }
558 } elseif ( !$page->isIncludable() ) {
559 return false;
560 }
561
562 $page->including( $including );
563 if ( $linkRenderer ) {
564 $page->setLinkRenderer( $linkRenderer );
565 }
566
567 // Execute special page
568 $page->run( $par );
569
570 return true;
571 }
572
588 public static function capturePath(
590 ) {
592 $main = RequestContext::getMain();
593
594 // Save current globals and main context
595 $glob = [
596 'title' => $wgTitle,
597 'output' => $wgOut,
598 'request' => $wgRequest,
599 'user' => $wgUser,
600 'language' => $wgLang,
601 ];
602 $ctx = [
603 'title' => $main->getTitle(),
604 'output' => $main->getOutput(),
605 'request' => $main->getRequest(),
606 'user' => $main->getUser(),
607 'language' => $main->getLanguage(),
608 ];
609
610 // Override
612 $wgOut = $context->getOutput();
613 $wgRequest = $context->getRequest();
614 $wgUser = $context->getUser();
615 $wgLang = $context->getLanguage();
616 $main->setTitle( $title );
617 $main->setOutput( $context->getOutput() );
618 $main->setRequest( $context->getRequest() );
619 $main->setUser( $context->getUser() );
620 $main->setLanguage( $context->getLanguage() );
621
622 // The useful part
624
625 // Restore old globals and context
626 $wgTitle = $glob['title'];
627 $wgOut = $glob['output'];
628 $wgRequest = $glob['request'];
629 $wgUser = $glob['user'];
630 $wgLang = $glob['language'];
631 $main->setTitle( $ctx['title'] );
632 $main->setOutput( $ctx['output'] );
633 $main->setRequest( $ctx['request'] );
634 $main->setUser( $ctx['user'] );
635 $main->setLanguage( $ctx['language'] );
636
637 return $ret;
638 }
639
647 public static function getLocalNameFor( $name, $subpage = false ) {
649 $aliases = $wgContLang->getSpecialPageAliases();
650 $aliasList = self::getAliasList();
651
652 // Find the first alias that maps back to $name
653 if ( isset( $aliases[$name] ) ) {
654 $found = false;
655 foreach ( $aliases[$name] as $alias ) {
656 $caseFoldedAlias = $wgContLang->caseFold( $alias );
657 $caseFoldedAlias = str_replace( ' ', '_', $caseFoldedAlias );
658 if ( isset( $aliasList[$caseFoldedAlias] ) &&
659 $aliasList[$caseFoldedAlias] === $name
660 ) {
661 $name = $alias;
662 $found = true;
663 break;
664 }
665 }
666 if ( !$found ) {
667 wfWarn( "Did not find a usable alias for special page '$name'. " .
668 "It seems all defined aliases conflict?" );
669 }
670 } else {
671 // Check if someone misspelled the correct casing
672 if ( is_array( $aliases ) ) {
673 foreach ( $aliases as $n => $values ) {
674 if ( strcasecmp( $name, $n ) === 0 ) {
675 wfWarn( "Found alias defined for $n when searching for " .
676 "special page aliases for $name. Case mismatch?" );
677 return self::getLocalNameFor( $n, $subpage );
678 }
679 }
680 }
681
682 wfWarn( "Did not find alias for special page '$name'. " .
683 "Perhaps no aliases are defined for it?" );
684 }
685
686 if ( $subpage !== false && !is_null( $subpage ) ) {
687 // Make sure it's in dbkey form
688 $subpage = str_replace( ' ', '_', $subpage );
689 $name = "$name/$subpage";
690 }
691
692 return $wgContLang->ucfirst( $name );
693 }
694
701 public static function getTitleForAlias( $alias ) {
702 list( $name, $subpage ) = self::resolveAlias( $alias );
703 if ( $name != null ) {
704 return SpecialPage::getTitleFor( $name, $subpage );
705 } else {
706 return null;
707 }
708 }
709}
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.
$wgUser
Definition Setup.php:902
$wgOut
Definition Setup.php:912
if(! $wgDBerrorLogTZ) $wgRequest
Definition Setup.php:737
if(! $wgRequest->checkUrlExtension()) if(isset($_SERVER[ 'PATH_INFO']) &&$_SERVER[ 'PATH_INFO'] !='') if(! $wgEnableAPI) $wgTitle
Definition api.php:68
Class that generates HTML links for pages.
run()
Run the current MediaWiki instance; index.php just calls this.
static getMain()
Get the RequestContext object associated with the main request.
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 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.
Represents a title within MediaWiki.
Definition Title.php:39
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition User.php:53
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
Definition deferred.txt:11
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
Definition design.txt:57
when a variable name is used in a it is silently declared as a new local masking the global
Definition design.txt:95
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
Definition design.txt:56
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
Definition hooks.txt:2811
namespace and then decline to actually register it file or subcat img or subcat $title
Definition hooks.txt:964
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
Definition hooks.txt:2005
Allows to change the fields on the form that will be generated $name
Definition hooks.txt:302
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
Definition hooks.txt:1620
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
Definition hooks.txt:2056
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
Definition hooks.txt:247
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
Definition injection.txt:37
Interface for objects which can provide a MediaWiki context on request.