MediaWiki REL1_31
Setup.php
Go to the documentation of this file.
1<?php
27
32if ( !defined( 'MEDIAWIKI' ) ) {
33 exit( 1 );
34}
35
40// Get profiler configuraton
42if ( file_exists( "$IP/StartProfiler.php" ) ) {
43 require "$IP/StartProfiler.php";
44}
45
46// Start the autoloader, so that extensions can derive classes from core files
47require_once "$IP/includes/AutoLoader.php";
48
49// Load up some global defines
50require_once "$IP/includes/Defines.php";
51
52// Load default settings
53require_once "$IP/includes/DefaultSettings.php";
54
55// Load global functions
56require_once "$IP/includes/GlobalFunctions.php";
57
58// Load composer's autoloader if present
59if ( is_readable( "$IP/vendor/autoload.php" ) ) {
60 require_once "$IP/vendor/autoload.php";
61}
62
63// Assert that composer dependencies were successfully loaded
64// Purposely no leading \ due to it breaking HHVM RepoAuthorative mode
65// PHP works fine with both versions
66// See https://github.com/facebook/hhvm/issues/5833
67if ( !interface_exists( 'Psr\Log\LoggerInterface' ) ) {
68 $message = (
69 'MediaWiki requires the <a href="https://github.com/php-fig/log">PSR-3 logging ' .
70 "library</a> to be present. This library is not embedded directly in MediaWiki's " .
71 "git repository and must be installed separately by the end user.\n\n" .
72 'Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git' .
73 '#Fetch_external_libraries">mediawiki.org</a> for help on installing ' .
74 'the required components.'
75 );
76 echo $message;
77 trigger_error( $message, E_USER_ERROR );
78 die( 1 );
79}
80
81// Install a header callback
82MediaWiki\HeaderCallback::register();
83
88if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
89 call_user_func( MW_CONFIG_CALLBACK );
90} else {
91 if ( !defined( 'MW_CONFIG_FILE' ) ) {
92 define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
93 }
94 require_once MW_CONFIG_FILE;
95}
96
104if ( defined( 'MW_SETUP_CALLBACK' ) ) {
105 call_user_func( MW_SETUP_CALLBACK );
106}
107
112$fname = 'Setup.php';
113$ps_setup = Profiler::instance()->scopedProfileIn( $fname );
114
115// Load queued extensions
116ExtensionRegistry::getInstance()->loadFromQueue();
117// Don't let any other extensions load
119
120// Check to see if we are at the file scope
121if ( !isset( $wgVersion ) ) {
122 echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
123 die( 1 );
124}
125
126mb_internal_encoding( 'UTF-8' );
127
128// Set the configured locale on all requests for consisteny
129putenv( "LC_ALL=$wgShellLocale" );
130setlocale( LC_ALL, $wgShellLocale );
131
132// Set various default paths sensibly...
133$ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );
134
135if ( $wgScript === false ) {
136 $wgScript = "$wgScriptPath/index.php";
137}
138if ( $wgLoadScript === false ) {
139 $wgLoadScript = "$wgScriptPath/load.php";
140}
141
142if ( $wgArticlePath === false ) {
143 if ( $wgUsePathInfo ) {
144 $wgArticlePath = "$wgScript/$1";
145 } else {
146 $wgArticlePath = "$wgScript?title=$1";
147 }
148}
149
150if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
151 // 'view' is assumed the default action path everywhere in the code
152 // but is rarely filled in $wgActionPaths
154}
155
156if ( $wgResourceBasePath === null ) {
158}
159if ( $wgStylePath === false ) {
160 $wgStylePath = "$wgResourceBasePath/skins";
161}
162if ( $wgLocalStylePath === false ) {
163 // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
164 $wgLocalStylePath = "$wgScriptPath/skins";
165}
166if ( $wgExtensionAssetsPath === false ) {
167 $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
168}
169
170if ( $wgLogo === false ) {
171 $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
172}
173
174if ( $wgUploadPath === false ) {
175 $wgUploadPath = "$wgScriptPath/images";
176}
177if ( $wgUploadDirectory === false ) {
178 $wgUploadDirectory = "$IP/images";
179}
180if ( $wgReadOnlyFile === false ) {
181 $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
182}
183if ( $wgFileCacheDirectory === false ) {
184 $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
185}
186if ( $wgDeletedDirectory === false ) {
187 $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
188}
189
190if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
191 $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
192}
193
194if ( $wgEnableParserCache === false ) {
196}
197
198// Fix path to icon images after they were moved in 1.24
199if ( $wgRightsIcon ) {
200 $wgRightsIcon = str_replace(
201 "{$wgStylePath}/common/images/",
202 "{$wgResourceBasePath}/resources/assets/licenses/",
204 );
205}
206
207if ( isset( $wgFooterIcons['copyright']['copyright'] )
208 && $wgFooterIcons['copyright']['copyright'] === []
209) {
210 if ( $wgRightsIcon || $wgRightsText ) {
211 $wgFooterIcons['copyright']['copyright'] = [
212 'url' => $wgRightsUrl,
213 'src' => $wgRightsIcon,
214 'alt' => $wgRightsText,
215 ];
216 }
217}
218
219if ( isset( $wgFooterIcons['poweredby'] )
220 && isset( $wgFooterIcons['poweredby']['mediawiki'] )
221 && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
222) {
223 $wgFooterIcons['poweredby']['mediawiki']['src'] =
224 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
225 $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
226 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
227 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
228}
229
238
246
251 'name' => 'fsLockManager',
252 'class' => FSLockManager::class,
253 'lockDirectory' => "{$wgUploadDirectory}/lockdir",
254];
255$wgLockManagers[] = [
256 'name' => 'nullLockManager',
257 'class' => NullLockManager::class,
258];
259
265 'imagesPerRow' => 0,
266 'imageWidth' => 120,
267 'imageHeight' => 120,
268 'captionLength' => true,
269 'showBytes' => true,
270 'showDimensions' => true,
271 'mode' => 'traditional',
272];
273
277if ( !$wgLocalFileRepo ) {
279 'class' => LocalRepo::class,
280 'name' => 'local',
281 'directory' => $wgUploadDirectory,
282 'scriptDirUrl' => $wgScriptPath,
284 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
285 'thumbScriptUrl' => $wgThumbnailScriptPath,
286 'transformVia404' => !$wgGenerateThumbnailOnParse,
287 'deletedDir' => $wgDeletedDirectory,
288 'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0
289 ];
290}
294if ( $wgUseSharedUploads ) {
295 if ( $wgSharedUploadDBname ) {
297 'class' => ForeignDBRepo::class,
298 'name' => 'shared',
299 'directory' => $wgSharedUploadDirectory,
300 'url' => $wgSharedUploadPath,
301 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
302 'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
303 'transformVia404' => !$wgGenerateThumbnailOnParse,
304 'dbType' => $wgDBtype,
305 'dbServer' => $wgDBserver,
306 'dbUser' => $wgDBuser,
307 'dbPassword' => $wgDBpassword,
308 'dbName' => $wgSharedUploadDBname,
309 'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
310 'tablePrefix' => $wgSharedUploadDBprefix,
311 'hasSharedCache' => $wgCacheSharedUploads,
312 'descBaseUrl' => $wgRepositoryBaseUrl,
313 'fetchDescription' => $wgFetchCommonsDescriptions,
314 ];
315 } else {
317 'class' => FileRepo::class,
318 'name' => 'shared',
319 'directory' => $wgSharedUploadDirectory,
320 'url' => $wgSharedUploadPath,
321 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
322 'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
323 'transformVia404' => !$wgGenerateThumbnailOnParse,
324 'descBaseUrl' => $wgRepositoryBaseUrl,
325 'fetchDescription' => $wgFetchCommonsDescriptions,
326 ];
327 }
328}
331 'class' => ForeignAPIRepo::class,
332 'name' => 'wikimediacommons',
333 'apibase' => 'https://commons.wikimedia.org/w/api.php',
334 'url' => 'https://upload.wikimedia.org/wikipedia/commons',
335 'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
336 'hashLevels' => 2,
337 'transformVia404' => true,
338 'fetchDescription' => true,
339 'descriptionCacheExpiry' => 43200,
340 'apiThumbCacheExpiry' => 0,
341 ];
342}
343/*
344 * Add on default file backend config for file repos.
345 * FileBackendGroup will handle initializing the backends.
346 */
347if ( !isset( $wgLocalFileRepo['backend'] ) ) {
348 $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
349}
350foreach ( $wgForeignFileRepos as &$repo ) {
351 if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
352 $repo['directory'] = $wgUploadDirectory; // b/c
353 }
354 if ( !isset( $repo['backend'] ) ) {
355 $repo['backend'] = $repo['name'] . '-backend';
356 }
357}
358unset( $repo ); // no global pollution; destroy reference
359
360// Convert this deprecated setting to modern system
362 wfDeprecated( '$wgExperimentalHtmlIds', '1.30' );
363 $wgFragmentMode = [ 'html5-legacy', 'html5' ];
364}
365
366$rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
367if ( $wgRCFilterByAge ) {
368 // Trim down $wgRCLinkDays so that it only lists links which are valid
369 // as determined by $wgRCMaxAge.
370 // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
371 sort( $wgRCLinkDays );
372
373 // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
374 for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
375 if ( $wgRCLinkDays[$i] >= $rcMaxAgeDays ) {
376 $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
377 break;
378 }
379 }
380}
381// Ensure that default user options are not invalid, since that breaks Special:Preferences
382$wgDefaultUserOptions['rcdays'] = min(
383 $wgDefaultUserOptions['rcdays'],
384 ceil( $rcMaxAgeDays )
385);
386$wgDefaultUserOptions['watchlistdays'] = min(
387 $wgDefaultUserOptions['watchlistdays'],
388 ceil( $rcMaxAgeDays )
389);
390unset( $rcMaxAgeDays );
391
392if ( $wgSkipSkin ) {
394}
395
396$wgSkipSkins[] = 'fallback';
397$wgSkipSkins[] = 'apioutput';
398
399if ( $wgLocalInterwiki ) {
400 array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
401}
402
403// Set default shared prefix
404if ( $wgSharedPrefix === false ) {
406}
407
408// Set default shared schema
409if ( $wgSharedSchema === false ) {
411}
412
413if ( !$wgCookiePrefix ) {
414 if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
416 } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
418 } elseif ( $wgDBprefix ) {
420 } else {
422 }
423}
424$wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
425
426if ( $wgEnableEmail ) {
428} else {
429 // Disable all other email settings automatically if $wgEnableEmail
430 // is set to false. - T65678
431 $wgAllowHTMLEmail = false;
432 $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
442 unset( $wgGroupPermissions['user']['sendemail'] );
446}
447
448if ( $wgMetaNamespace === false ) {
449 $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
450}
451
452// Default value is 2000 or the suhosin limit if it is between 1 and 2000
453if ( $wgResourceLoaderMaxQueryLength === false ) {
454 $suhosinMaxValueLength = (int)ini_get( 'suhosin.get.max_value_length' );
455 if ( $suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000 ) {
456 $wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength;
457 } else {
459 }
460 unset( $suhosinMaxValueLength );
461}
462
463// Ensure the minimum chunk size is less than PHP upload limits or the maximum
464// upload size.
470 ini_get( 'post_max_size' ) ?: ini_get( 'hhvm.server.max_post_size' ),
471 PHP_INT_MAX
472 ) ?: PHP_INT_MAX ) - 1024 // Leave some room for other POST parameters
473);
474
480 NS_MEDIA => 'Media',
481 NS_SPECIAL => 'Special',
482 NS_TALK => 'Talk',
483 NS_USER => 'User',
484 NS_USER_TALK => 'User_talk',
485 NS_PROJECT => 'Project',
486 NS_PROJECT_TALK => 'Project_talk',
487 NS_FILE => 'File',
488 NS_FILE_TALK => 'File_talk',
489 NS_MEDIAWIKI => 'MediaWiki',
490 NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
491 NS_TEMPLATE => 'Template',
492 NS_TEMPLATE_TALK => 'Template_talk',
493 NS_HELP => 'Help',
494 NS_HELP_TALK => 'Help_talk',
495 NS_CATEGORY => 'Category',
496 NS_CATEGORY_TALK => 'Category_talk',
497];
498
500if ( is_array( $wgExtraNamespaces ) ) {
502}
503
504// Merge in the legacy language codes, incorporating overrides from the config
506 'qqq' => 'qqq', // Used for message documentation
507 'qqx' => 'qqx', // Used for viewing message keys
508] + $wgExtraLanguageCodes + LanguageCode::getDeprecatedCodeMapping();
509
510// These are now the same, always
511// To determine the user language, use $wgLang->getCode()
513
514// Easy to forget to falsify $wgDebugToolbar for static caches.
515// If file cache or CDN cache is on, just disable this (DWIMD).
517 $wgDebugToolbar = false;
518}
519
520// We always output HTML5 since 1.22, overriding these is no longer supported
521// we set them here for extensions that depend on its value.
522$wgHtml5 = true;
523$wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
524$wgJsMimeType = 'text/javascript';
525
526// Blacklisted file extensions shouldn't appear on the "allowed" list
527$wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
528
530 Wikimedia\suppressWarnings();
531 $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
532 Wikimedia\restoreWarnings();
533}
534
535if ( $wgNewUserLog ) {
536 // Add a new log type
537 $wgLogTypes[] = 'newusers';
538 $wgLogNames['newusers'] = 'newuserlogpage';
539 $wgLogHeaders['newusers'] = 'newuserlogpagetext';
540 $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
541 $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
542 $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
543 $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
544 $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
545}
546
548 $wgLogTypes[] = 'pagelang';
549 $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
550}
551
552if ( $wgCookieSecure === 'detect' ) {
554}
555
556if ( $wgProfileOnly ) {
557 $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
558 $wgDebugLogFile = '';
559}
560
561// Backwards compatibility with old password limits
562if ( $wgMinimalPasswordLength !== false ) {
563 $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
564}
565
566if ( $wgMaximalPasswordLength !== false ) {
567 $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
568}
569
570// Backwards compatibility warning
572 wfDeprecated( '$wgSessionsInObjectCache = false', '1.27' );
573 if ( $wgSessionHandler ) {
574 wfDeprecated( '$wgSessionsHandler', '1.27' );
575 }
576 $cacheType = get_class( ObjectCache::getInstance( $wgSessionCacheType ) );
578 'caches',
579 "Session data will be stored in \"$cacheType\" cache with " .
580 "expiry $wgObjectCacheSessionExpiry seconds"
581 );
582}
584
585if ( $wgPHPSessionHandling !== 'enable' &&
586 $wgPHPSessionHandling !== 'warn' &&
587 $wgPHPSessionHandling !== 'disable'
588) {
589 $wgPHPSessionHandling = 'warn';
590}
591if ( defined( 'MW_NO_SESSION' ) ) {
592 // If the entry point wants no session, force 'disable' here unless they
593 // specifically set it to the (undocumented) 'warn'.
594 $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
595}
596
597Profiler::instance()->scopedProfileOut( $ps_default );
598
599// Disable MWDebug for command line mode, this prevents MWDebug from eating up
600// all the memory from logging SQL queries on maintenance scripts
603 MWDebug::init();
604}
605
606// Reset the global service locator, so any services that have already been created will be
607// re-created while taking into account any custom settings and extensions.
608MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
609
611 // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
612 MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
613 array_fill_keys(
615 [
616 'dbname' => $wgSharedDB,
617 'schema' => $wgSharedSchema,
618 'prefix' => $wgSharedPrefix
619 ]
620 )
621 );
622}
623
624// Define a constant that indicates that the bootstrapping of the service locator
625// is complete.
626define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
627
628MWExceptionHandler::installHandler();
629
630require_once "$IP/includes/compat/normal/UtfNormalUtil.php";
631
632$ps_validation = Profiler::instance()->scopedProfileIn( $fname . '-validation' );
633
634// T48998: Bail out early if $wgArticlePath is non-absolute
635foreach ( [ 'wgArticlePath', 'wgVariantArticlePath' ] as $varName ) {
636 if ( $$varName && !preg_match( '/^(https?:\/\/|\/)/', $$varName ) ) {
637 throw new FatalError(
638 "If you use a relative URL for \$$varName, it must start " .
639 'with a slash (<code>/</code>).<br><br>See ' .
640 "<a href=\"https://www.mediawiki.org/wiki/Manual:\$$varName\">" .
641 "https://www.mediawiki.org/wiki/Manual:\$$varName</a>."
642 );
643 }
644}
645
646Profiler::instance()->scopedProfileOut( $ps_validation );
647
648$ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' );
649
650if ( $wgCanonicalServer === false ) {
652}
653
654// Set server name
656if ( $wgServerName !== false ) {
657 wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
658 . 'not customized. Overwriting $wgServerName.' );
659}
661unset( $serverParts );
662
663// Set defaults for configuration variables
664// that are derived from the server name by default
665// Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
666if ( !$wgEmergencyContact ) {
667 $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
668}
669if ( !$wgPasswordSender ) {
670 $wgPasswordSender = 'apache@' . $wgServerName;
671}
672if ( !$wgNoReplyAddress ) {
674}
675
676if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
677 $wgSecureLogin = false;
678 wfWarn( 'Secure login was enabled on a server that only supports '
679 . 'HTTP or HTTPS. Disabling secure login.' );
680}
681
683
684// Now that GlobalFunctions is loaded, set defaults that depend on it.
685if ( $wgTmpDirectory === false ) {
687}
688
689// We don't use counters anymore. Left here for extensions still
690// expecting this to exist. Should be removed sometime 1.26 or later.
691if ( !isset( $wgDisableCounters ) ) {
692 $wgDisableCounters = true;
693}
694
695if ( $wgMainWANCache === false ) {
696 // Setup a WAN cache from $wgMainCacheType with no relayer.
697 // Sites using multiple datacenters can configure a relayer.
698 $wgMainWANCache = 'mediawiki-main-default';
700 'class' => WANObjectCache::class,
701 'cacheId' => $wgMainCacheType,
702 'channels' => [ 'purge' => 'wancache-main-default-purge' ]
703 ];
704}
705
706Profiler::instance()->scopedProfileOut( $ps_default2 );
707
708$ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc1' );
709
710// Raise the memory limit if it's too low
712
718if ( is_null( $wgLocaltimezone ) ) {
719 Wikimedia\suppressWarnings();
720 $wgLocaltimezone = date_default_timezone_get();
721 Wikimedia\restoreWarnings();
722}
723
724date_default_timezone_set( $wgLocaltimezone );
725if ( is_null( $wgLocalTZoffset ) ) {
726 $wgLocalTZoffset = date( 'Z' ) / 60;
727}
728// The part after the System| is ignored, but rest of MW fills it
729// out as the local offset.
730$wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
731
732if ( !$wgDBerrorLogTZ ) {
734}
735
736// Initialize the request object in $wgRequest
737$wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
738// Set user IP/agent information for agent session consistency purposes
739MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
740 'IPAddress' => $wgRequest->getIP(),
741 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
742 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ),
743 // The cpPosIndex cookie has no prefix and is set by MediaWiki::preOutputCommit()
744 'ChronologyPositionIndex' =>
745 $wgRequest->getInt( 'cpPosIndex', (int)$wgRequest->getCookie( 'cpPosIndex', '' ) )
746] );
747// Make sure that object caching does not undermine the ChronologyProtector improvements
748if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
749 // The user is pinned to the primary DC, meaning that they made recent changes which should
750 // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
751 // they use a blind TTL and could be stale if an object changes twice in a short time span.
752 MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
753}
754
755// Useful debug output
756if ( $wgCommandLineMode ) {
757 wfDebug( "\n\nStart command line script $self\n" );
758} else {
759 $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
760
762 $debug .= "HTTP HEADERS:\n";
763
764 foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
765 $debug .= "$name: $value\n";
766 }
767 }
768 wfDebug( $debug );
769}
770
771Profiler::instance()->scopedProfileOut( $ps_misc );
772$ps_memcached = Profiler::instance()->scopedProfileIn( $fname . '-memcached' );
773
776
780$parserMemc = new DeprecatedGlobal( 'parserMemc', function () {
781 return MediaWikiServices::getInstance()->getParserCache()->getCacheStorage();
782}, '1.30' );
783
784wfDebugLog( 'caches',
785 'cluster: ' . get_class( $wgMemc ) .
786 ', WAN: ' . ( $wgMainWANCache === CACHE_NONE ? 'CACHE_NONE' : $wgMainWANCache ) .
787 ', stash: ' . $wgMainStash .
788 ', message: ' . get_class( $messageMemc ) .
789 ', session: ' . get_class( ObjectCache::getInstance( $wgSessionCacheType ) )
790);
791
792Profiler::instance()->scopedProfileOut( $ps_memcached );
793
794// Most of the config is out, some might want to run hooks here.
795Hooks::run( 'SetupAfterCache' );
796
797$ps_globals = Profiler::instance()->scopedProfileIn( $fname . '-globals' );
798
802$wgContLang = Language::factory( $wgLanguageCode );
803$wgContLang->initContLang();
804
805// Now that variant lists may be available...
806$wgRequest->interpolateTitle();
807
808if ( !is_object( $wgAuth ) ) {
810 Hooks::run( 'AuthPluginSetup', [ &$wgAuth ] );
811}
812if ( $wgAuth && !$wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin ) {
813 MediaWiki\Auth\AuthManager::singleton()->forcePrimaryAuthenticationProviders( [
814 new MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider( [
815 'authoritative' => false,
816 ] ),
817 new MediaWiki\Auth\AuthPluginPrimaryAuthenticationProvider( $wgAuth ),
818 new MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider( [
819 'authoritative' => true,
820 ] ),
821 ], '$wgAuth is ' . get_class( $wgAuth ) );
822}
823
824// Set up the session
825$ps_session = Profiler::instance()->scopedProfileIn( $fname . '-session' );
831if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
832 // If session.auto_start is there, we can't touch session name
833 if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
834 session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
835 }
836
837 // Create the SessionManager singleton and set up our session handler,
838 // unless we're specifically asked not to.
839 if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
840 MediaWiki\Session\PHPSessionHandler::install(
841 MediaWiki\Session\SessionManager::singleton()
842 );
843 }
844
845 // Initialize the session
846 try {
847 $session = MediaWiki\Session\SessionManager::getGlobalSession();
848 } catch ( OverflowException $ex ) {
849 if ( isset( $ex->sessionInfos ) && count( $ex->sessionInfos ) >= 2 ) {
850 // The exception is because the request had multiple possible
851 // sessions tied for top priority. Report this to the user.
852 $list = [];
853 foreach ( $ex->sessionInfos as $info ) {
854 $list[] = $info->getProvider()->describe( $wgContLang );
855 }
856 $list = $wgContLang->listToText( $list );
857 throw new HttpError( 400,
858 Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
859 );
860 }
861
862 // Not the one we want, rethrow
863 throw $ex;
864 }
865
866 if ( $session->isPersistent() ) {
867 $wgInitialSessionId = $session->getSessionId();
868 }
869
870 $session->renew();
871 if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
872 ( $session->isPersistent() || $session->shouldRememberUser() ) &&
873 session_id() !== $session->getId()
874 ) {
875 // Start the PHP-session for backwards compatibility
876 if ( session_id() !== '' ) {
877 wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
878 'old_id' => session_id(),
879 'new_id' => $session->getId(),
880 ] );
881 session_write_close();
882 }
883 session_id( $session->getId() );
884 session_start();
885 }
886
887 unset( $session );
888} else {
889 // Even if we didn't set up a global Session, still install our session
890 // handler unless specifically requested not to.
891 if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
892 MediaWiki\Session\PHPSessionHandler::install(
893 MediaWiki\Session\SessionManager::singleton()
894 );
895 }
896}
897Profiler::instance()->scopedProfileOut( $ps_session );
898
902$wgUser = RequestContext::getMain()->getUser(); // BackCompat
903
908
912$wgOut = RequestContext::getMain()->getOutput(); // BackCompat
913
917$wgParser = new StubObject( 'wgParser', function () {
918 return MediaWikiServices::getInstance()->getParser();
919} );
920
924$wgTitle = null;
925
926Profiler::instance()->scopedProfileOut( $ps_globals );
927$ps_extensions = Profiler::instance()->scopedProfileIn( $fname . '-extensions' );
928
929// Extension setup functions
930// Entries should be added to this variable during the inclusion
931// of the extension file. This allows the extension to perform
932// any necessary initialisation in the fully initialised environment
933foreach ( $wgExtensionFunctions as $func ) {
934 // Allow closures in PHP 5.3+
935 if ( is_object( $func ) && $func instanceof Closure ) {
936 $profName = $fname . '-extensions-closure';
937 } elseif ( is_array( $func ) ) {
938 if ( is_object( $func[0] ) ) {
939 $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
940 } else {
941 $profName = $fname . '-extensions-' . implode( '::', $func );
942 }
943 } else {
944 $profName = $fname . '-extensions-' . strval( $func );
945 }
946
947 $ps_ext_func = Profiler::instance()->scopedProfileIn( $profName );
948 call_user_func( $func );
949 Profiler::instance()->scopedProfileOut( $ps_ext_func );
950}
951
952// If the session user has a 0 id but a valid name, that means we need to
953// autocreate it.
954if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
955 $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
956 if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
957 $ps_autocreate = Profiler::instance()->scopedProfileIn( $fname . '-autocreate' );
958 $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
959 $sessionUser,
960 MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
961 true
962 );
963 Profiler::instance()->scopedProfileOut( $ps_autocreate );
964 \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
965 'event' => 'autocreate',
966 'status' => $res,
967 ] );
968 unset( $res );
969 }
970 unset( $sessionUser );
971}
972
973if ( !$wgCommandLineMode ) {
975}
976
978
979Profiler::instance()->scopedProfileOut( $ps_extensions );
980Profiler::instance()->scopedProfileOut( $ps_setup );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgRightsIcon
Override for copyright metadata.
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
$wgUsePathInfo
Whether to support URLs like index.php/Page_title These often break when PHP is set up in CGI mode.
$wgLanguageCode
Site language code.
$wgParserCacheType
The cache type for storing article HTML.
$wgSessionHandler
$wgSharedThumbnailScriptPath
$wgEmergencyContact
Site admin email address.
$wgDBprefix
Table name prefix.
$wgDBuser
Database username.
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
$wgScript
The URL path to index.php.
$wgUseInstantCommons
Use Commons as a remote file repository.
$wgCacheDirectory
Directory for caching data in the local filesystem.
$wgHashedSharedUploadDirectory
Set the following to false especially if you have a set of files that need to be accessible by all wi...
$wgGenerateThumbnailOnParse
Allow thumbnail rendering on page view.
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki.
$wgSharedTables
$wgSessionName
Override to customise the session name.
$wgLocalInterwiki
The interwiki prefix of the current wiki, or false if it doesn't have one.
$wgPasswordPolicy
Password policy for local wiki users.
$wgLogNames
Lists the message key string for each log type.
$wgSharedUploadPath
Full path on the web server where shared uploads can be found.
$wgHashedUploadDirectory
Set this to false if you do not want MediaWiki to divide your images directory into many subdirectori...
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
$wgLocalStylePath
The URL path of the skins directory.
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
$wgExtraNamespaces
Additional namespaces.
$wgTmpDirectory
The local filesystem path to a temporary directory.
$wgDBtype
Database type.
$wgDBmwschema
Mediawiki schema.
$wgNoReplyAddress
Reply-To address for e-mail notifications.
$wgDBerrorLogTZ
Timezone to use in the error log.
$wgUploadDirectory
The filesystem path of the images directory.
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
$wgSitename
Name of the site.
$wgSharedUploadDirectory
Path on the file system where shared uploads can be found.
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
$wgResourceLoaderMaxQueryLength
If set to a positive number, ResourceLoader will not generate URLs whose query string is more than th...
$wgFileCacheDirectory
Directory where the cached page will be saved.
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
$wgProfileOnly
Don't put non-profiling info into log file.
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
$wgUploadPath
The URL path for the images directory.
$wgCacheSharedUploads
Cache shared metadata in memcached.
$wgEnableParserCache
Kept for extension compatibility; see $wgParserCacheType.
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
$wgUseSquid
Enable/disable CDN.
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
$wgSecureLogin
This is to let user authenticate using https when they come from http.
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
$wgUploadBaseUrl
If set, this URL is added to the start of $wgUploadPath to form a complete upload URL.
$wgGroupPermissions
Permission keys given to users in each group.
$wgLocalInterwikis
Array for multiple $wgLocalInterwiki values, in case there are several interwiki prefixes that point ...
$wgVersion
MediaWiki version number.
$wgExperimentalHtmlIds
Abandoned experiment with HTML5-style ID escaping.
$wgLocalFileRepo
File repository structures.
$wgDeletedDirectory
What directory to place deleted uploads in.
$wgScriptPath
The path we should point to.
$wgWANObjectCaches
Advanced WAN object cache configuration.
$wgAuth $wgAuth
Authentication plugin.
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
$wgFragmentMode
How should section IDs be encoded? This array can contain 1 or 2 elements, each of them can be one of...
$wgSharedUploadDBname
DB name with metadata about shared directory.
$wgMainStash
Main object stash type.
$wgExtensionAssetsPath
The URL path of the extensions directory.
$wgDebugToolbar
Display the new debugging toolbar.
$wgForeignFileRepos
$wgRepositoryBaseUrl
Base URL for a repository wiki.
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
$wgDebugLogGroups
Map of string log group names to log destinations.
$wgSharedDB
Shared database for multiple wikis.
$wgSessionCacheType
The cache type for storing session data.
$wgSharedUploadDBprefix
Optional table prefix used in database.
$wgDebugDumpSql
Write SQL queries to the debug log.
$wgFetchCommonsDescriptions
Fetch commons image description pages and display them on the local wiki?
$wgDBserver
Database host name or IP address.
bool $wgForceHTTPS
If this is true, when an insecure HTTP request is received, always redirect to HTTPS.
$wgLoadScript
The URL path to load.php.
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
$wgExtraLanguageCodes
List of mappings from one language code to another.
$wgCanonicalServer
Canonical URL of the server, to use in IRC feeds and notification e-mails.
$wgStylePath
The URL path of the skins directory.
$wgServer
URL of the server.
$wgRCFilterByAge
Filter $wgRCLinkDays by $wgRCMaxAge to avoid showing links for numbers higher than what will be store...
$wgMinimalPasswordLength
Specifies the minimal length of a user password.
$wgMetaNamespace
Name of the project namespace.
$wgLogo
The URL path of the wiki logo.
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
$wgSharedSchema
$wgDebugLogFile
Filename for debug logging.
$wgPasswordSender
Sender email address for e-mail notifications.
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
$wgSharedPrefix
$wgMainWANCache
Main Wide-Area-Network cache type.
$wgDebugPrintHttpHeaders
Print HTTP headers for every request in the debug information.
$wgUseSharedUploads
If you operate multiple wikis, you can define a shared upload path here.
$wgDBpassword
Database user's password.
$wgRCLinkDays
List of Days options to list in the Special:Recentchanges and Special:Recentchangeslinked pages.
$wgNewUserLog
Maintain a log of newusers at Log/newusers?
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
wfTempDir()
Tries to get the system directory for temporary files.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
wfGetMessageCacheStorage()
Get the cache object used by the message cache.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
wfGetMainCache()
Get the main cache object.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
wfMemoryLimit()
Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
$wgGalleryOptions
Default parameters for the "<gallery>" tag.
Definition Setup.php:264
$ps_extensions
Definition Setup.php:927
$messageMemc
Definition Setup.php:775
$parserMemc
Definition Setup.php:780
$wgFileExtensions
Definition Setup.php:527
$wgEnotifWatchlist
Definition Setup.php:441
$ps_memcached
Definition Setup.php:772
$wgEnotifMaxRecips
Definition Setup.php:436
$wgEnotifUserTalk
Definition Setup.php:440
if($wgInvalidateCacheOnLocalSettingsChange) if( $wgNewUserLog) if($wgPageLanguageUseDB) if( $wgCookieSecure==='detect') if($wgProfileOnly) if( $wgMinimalPasswordLength !==false) if($wgMaximalPasswordLength !==false) if(! $wgSessionsInObjectCache) $wgSessionsInObjectCache
Definition Setup.php:583
if( $wgRCFilterByAge) $wgDefaultUserOptions['rcdays']
Definition Setup.php:382
$wgUser
Definition Setup.php:902
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
Definition Setup.php:112
$wgEnableUserEmail
Definition Setup.php:433
if( $wgUseFileCache|| $wgUseSquid) $wgHtml5
Definition Setup.php:522
$ps_validation
Definition Setup.php:632
$wgOut
Definition Setup.php:912
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition Setup.php:479
$wgMemc
Definition Setup.php:774
$wgParser
Definition Setup.php:917
global $wgCommandLineMode
Definition Setup.php:601
foreach( $wgExtensionFunctions as $func) if(!defined('MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition Setup.php:977
$wgTitle
Definition Setup.php:924
if(is_array( $wgExtraNamespaces)) $wgDummyLanguageCodes
Definition Setup.php:505
if(!is_object($wgAuth)) if( $wgAuth &&! $wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin) $ps_session
Definition Setup.php:825
$wgEnotifFromEditor
Definition Setup.php:434
$wgJsMimeType
Definition Setup.php:524
$wgUseEnotif
Definition Setup.php:443
$wgEnotifRevealEditorAddress
Definition Setup.php:438
if( $wgExperimentalHtmlIds) $rcMaxAgeDays
Definition Setup.php:366
$wgInitialSessionId
Definition Setup.php:830
$wgEnotifImpersonal
Definition Setup.php:435
$wgContLanguageCode
Definition Setup.php:512
if(!defined( 'MEDIAWIKI')) $wgProfiler
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
Definition Setup.php:41
$wgUsersNotifiedOnAllChanges
Definition Setup.php:445
$wgUserEmailUseReplyTo
Definition Setup.php:444
if(! $wgDBerrorLogTZ) $wgRequest
Definition Setup.php:737
$wgLang
Definition Setup.php:907
$ps_default2
Definition Setup.php:648
$wgContLang
Definition Setup.php:802
$ps_default
Definition Setup.php:133
if($wgLocalInterwiki) if( $wgSharedPrefix===false) if($wgSharedSchema===false) if(! $wgCookiePrefix) $wgCookiePrefix
Definition Setup.php:424
if( $wgServerName !==false) $wgServerName
Definition Setup.php:660
$wgEnotifMinorEdits
Definition Setup.php:437
$ps_setup
Definition Setup.php:113
$ps_globals
Definition Setup.php:797
$wgXhtmlDefaultNamespace
Definition Setup.php:523
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition Setup.php:250
$wgEmailAuthentication
Definition Setup.php:432
$wgNamespaceAliases['Image']
The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk".
Definition Setup.php:244
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig['global']['domain']
Definition Setup.php:682
if( $wgCanonicalServer===false) $serverParts
Definition Setup.php:655
$ps_misc
Definition Setup.php:708
if( $wgSkipSkin) $wgSkipSkins[]
Definition Setup.php:396
if( $wgScript===false) if($wgLoadScript===false) if( $wgArticlePath===false) if(!empty($wgActionPaths) &&!isset($wgActionPaths[ 'view'])) if( $wgResourceBasePath===null) if($wgStylePath===false) if( $wgLocalStylePath===false) if($wgExtensionAssetsPath===false) if( $wgLogo===false) if($wgUploadPath===false) if( $wgUploadDirectory===false) if($wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if($wgDeletedDirectory===false) if( $wgGitInfoCacheDirectory===false && $wgCacheDirectory !==false) if($wgEnableParserCache===false) if( $wgRightsIcon) if(isset($wgFooterIcons[ 'copyright'][ 'copyright']) &&$wgFooterIcons[ 'copyright'][ 'copyright']===[]) if(isset( $wgFooterIcons['poweredby']) &&isset( $wgFooterIcons['poweredby']['mediawiki']) && $wgFooterIcons['poweredby']['mediawiki']['src']===null) $wgNamespaceProtection[NS_MEDIAWIKI]
Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a sysadmin to set $wgName...
Definition Setup.php:237
$wgEnotifUseRealName
Definition Setup.php:439
if($wgMetaNamespace===false) if( $wgResourceLoaderMaxQueryLength===false) $wgMinUploadChunkSize
Definition Setup.php:465
Class to allow throwing wfDeprecated warnings when people use globals that we do not want them to.
Exception class which takes an HTML error message, and does not produce a backtrace.
Accesses configuration settings from $GLOBALS.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition Hooks.php:203
Show an error that looks like an HTTP server error.
Definition HttpError.php:30
Backwards-compatibility wrapper for AuthManager via $wgAuth.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Functions to get cache objects.
static schedulePingback()
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send...
Definition Pingback.php:271
static instance()
Singleton.
Definition Profiler.php:62
static getMain()
Get the RequestContext object associated with the main request.
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Stub object for the user language.
static getMaxUploadSize( $forType=null)
Get the MediaWiki maximum uploaded file size for given type of upload, based on $wgMaxUploadSize.
static getMaxPhpUploadSize()
Get the PHP maximum uploaded file size, based on ini settings.
static isValidUserName( $name)
Is the input a valid username?
Definition User.php:969
static detectProtocol()
Detect the protocol from $_SERVER.
$res
Definition database.txt:21
when a variable name is used in a it is silently declared as a new local masking the global
Definition design.txt:95
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
const NS_HELP
Definition Defines.php:86
const NS_USER
Definition Defines.php:76
const NS_FILE
Definition Defines.php:80
const CACHE_NONE
Definition Defines.php:112
const NS_MEDIAWIKI_TALK
Definition Defines.php:83
const NS_PROJECT_TALK
Definition Defines.php:79
const NS_MEDIAWIKI
Definition Defines.php:82
const NS_TEMPLATE
Definition Defines.php:84
const NS_SPECIAL
Definition Defines.php:63
const NS_FILE_TALK
Definition Defines.php:81
const NS_HELP_TALK
Definition Defines.php:87
const NS_CATEGORY_TALK
Definition Defines.php:89
const PROTO_HTTP
Definition Defines.php:229
const NS_MEDIA
Definition Defines.php:62
const NS_TALK
Definition Defines.php:75
const NS_USER_TALK
Definition Defines.php:77
const NS_PROJECT
Definition Defines.php:78
const NS_CATEGORY
Definition Defines.php:88
const NS_TEMPLATE_TALK
Definition Defines.php:85
either a plain
Definition hooks.txt:2056
$wgActionPaths
Definition img_auth.php:46
$wgArticlePath
Definition img_auth.php:45
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
const MW_CONFIG_CALLBACK
Definition install.php:26
const MW_NO_SESSION
Definition load.php:30
$debug
Definition mcc.php:31
controlled by $wgMainCacheType controlled by $wgParserCacheType controlled by $wgMessageCacheType If you set CACHE_NONE to one of the three control default value for MediaWiki still create a but requests to it are no ops and we always fall through to the database If the cache daemon can t be it should also disable itself fairly smoothly By $wgMemc is used but when it is $parserMemc or $messageMemc this is mentioned $wgDBname
CACHE_MEMCACHED $wgMainCacheType
Definition memcached.txt:63
A helper class for throttling authentication attempts.
const DBO_DEFAULT
Definition defines.php:13
const DBO_DEBUG
Definition defines.php:9