MediaWiki  master
Setup.php
Go to the documentation of this file.
1 <?php
59 use Psr\Log\LoggerInterface;
60 use Wikimedia\RequestTimeout\RequestTimeout;
61 
69 // This file must be included from a valid entry point (e.g. WebStart.php, Maintenance.php)
70 if ( !defined( 'MEDIAWIKI' ) ) {
71  exit( 1 );
72 }
73 
74 // This file must have global scope.
75 $wgScopeTest = 'MediaWiki Setup.php scope test';
76 if ( !isset( $GLOBALS['wgScopeTest'] ) || $GLOBALS['wgScopeTest'] !== $wgScopeTest ) {
77  echo "Error, Setup.php must be included from the file scope.\n";
78  die( 1 );
79 }
80 unset( $wgScopeTest );
81 
82 // PHP must not be configured to overload mbstring functions. (T5782, T122807)
83 // This was deprecated by upstream in PHP 7.2, likely to be removed in PHP 8.0.
84 if ( ini_get( 'mbstring.func_overload' ) ) {
85  die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
86 }
87 
88 // The MW_ENTRY_POINT constant must always exists, to make it safe to access.
89 // For compat, we do support older and custom MW entryoints that don't set this,
90 // in which case we assign a default here.
91 if ( !defined( 'MW_ENTRY_POINT' ) ) {
97  define( 'MW_ENTRY_POINT', 'unknown' );
98 }
99 
105 require_once "$IP/includes/AutoLoader.php";
106 require_once "$IP/includes/Defines.php";
107 
108 // Load composer's autoloader if present
109 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
110  require_once "$IP/vendor/autoload.php";
111 } elseif ( file_exists( "$IP/vendor/autoload.php" ) ) {
112  die( "$IP/vendor/autoload.php exists but is not readable" );
113 }
114 
115 // Assert that composer dependencies were successfully loaded
116 if ( !interface_exists( LoggerInterface::class ) ) {
117  $message = (
118  'MediaWiki requires the <a href="https://github.com/php-fig/log">PSR-3 logging ' .
119  "library</a> to be present. This library is not embedded directly in MediaWiki's " .
120  "git repository and must be installed separately by the end user.\n\n" .
121  'Please see the <a href="https://www.mediawiki.org/wiki/Download_from_Git' .
122  '#Fetch_external_libraries">instructions for installing libraries</a> on mediawiki.org ' .
123  'for help on installing the required components.'
124  );
125  echo $message;
126  trigger_error( $message, E_USER_ERROR );
127 }
128 
129 // Define $wgSettings for use in DefaultSettings.php and in LocalSettings.php
130 global $wgSettings; // explicitly global, so it works with wfRequireOnceInGlobalScope()
132  $IP,
134  new GlobalConfigBuilder( 'wg' ),
135  new PhpIniSink()
136 );
137 
138 require_once "$IP/includes/DefaultSettings.php";
139 require_once "$IP/includes/GlobalFunctions.php";
140 
141 HeaderCallback::register();
142 
143 // Set the encoding used by PHP for reading HTTP input, and writing output.
144 // This is also the default for mbstring functions.
145 mb_internal_encoding( 'UTF-8' );
146 
151 // Make any default settings available in globals for use in LocalSettings.php
152 $wgSettings->apply();
153 
154 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
155  call_user_func( MW_CONFIG_CALLBACK );
156 } else {
157  if ( !defined( 'MW_CONFIG_FILE' ) ) {
158  define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
159  }
160  require_once MW_CONFIG_FILE;
161 }
162 
163 // Make settings loaded by LocalSettings.php available in globals for use here
164 $wgSettings->apply();
165 
173 if ( defined( 'MW_SETUP_CALLBACK' ) ) {
174  call_user_func( MW_SETUP_CALLBACK );
175  // Make any additional settings available in globals for use here
176  $wgSettings->apply();
177 }
178 
179 // All settings should be loaded now.
180 $wgSettings->finalize();
181 
182 // Start time limit
184  RequestTimeout::singleton()->setWallTimeLimit( $wgRequestTimeLimit );
185 }
186 
191 ExtensionRegistry::getInstance()->loadFromQueue();
192 // Don't let any other extensions load
194 
195 // Set an appropriate locale (T291234)
196 // setlocale() will return the locale name actually set.
197 // The putenv() is meant to propagate the choice of locale to shell commands
198 // so that they will interpret UTF-8 correctly. If you have a problem with a
199 // shell command and need to send a special locale, you can override the locale
200 // with Command::environment().
201 putenv( "LC_ALL=" . setlocale( LC_ALL, 'C.UTF-8', 'C' ) );
202 
207 if ( $wgScript === false ) {
208  $wgScript = "$wgScriptPath/index.php";
209 }
210 if ( $wgLoadScript === false ) {
211  $wgLoadScript = "$wgScriptPath/load.php";
212 }
213 if ( $wgRestPath === false ) {
214  $wgRestPath = "$wgScriptPath/rest.php";
215 }
216 if ( $wgArticlePath === false ) {
217  if ( $wgUsePathInfo ) {
218  $wgArticlePath = "$wgScript/$1";
219  } else {
220  $wgArticlePath = "$wgScript?title=$1";
221  }
222 }
223 if ( $wgResourceBasePath === null ) {
225 }
226 if ( $wgStylePath === false ) {
227  $wgStylePath = "$wgResourceBasePath/skins";
228 }
229 if ( $wgLocalStylePath === false ) {
230  // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
231  $wgLocalStylePath = "$wgScriptPath/skins";
232 }
233 if ( $wgExtensionAssetsPath === false ) {
234  $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
235 }
236 
237 // For backwards compatibility, the value of wgLogos is copied to wgLogo.
238 // This is because some extensions/skins may be using $config->get('Logo')
239 // to access the value.
240 if ( $wgLogos !== false && isset( $wgLogos['1x'] ) ) {
241  $wgLogo = $wgLogos['1x'];
242 }
243 if ( $wgLogo === false ) {
244  $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
245 }
246 
247 if ( $wgUploadPath === false ) {
248  $wgUploadPath = "$wgScriptPath/images";
249 }
250 if ( $wgUploadDirectory === false ) {
251  $wgUploadDirectory = "$IP/images";
252 }
253 if ( $wgReadOnlyFile === false ) {
254  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
255 }
256 if ( $wgFileCacheDirectory === false ) {
257  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
258 }
259 if ( $wgDeletedDirectory === false ) {
260  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
261 }
262 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
263  $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
264 }
265 if ( $wgSharedPrefix === false ) {
267 }
268 if ( $wgSharedSchema === false ) {
270 }
271 if ( $wgMetaNamespace === false ) {
272  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
273 }
274 
275 if ( $wgMainWANCache === false ) {
276  // Create a WAN cache from $wgMainCacheType
277  $wgMainWANCache = 'mediawiki-main-default';
279  'class' => WANObjectCache::class,
280  'cacheId' => $wgMainCacheType,
281  ];
282 }
283 
284 // Back-compat
285 if ( isset( $wgFileBlacklist ) ) {
286  $wgProhibitedFileExtensions = array_merge( $wgProhibitedFileExtensions, $wgFileBlacklist );
287 } else {
288  $wgFileBlacklist = $wgProhibitedFileExtensions;
289 }
290 if ( isset( $wgMimeTypeBlacklist ) ) {
291  $wgMimeTypeExclusions = array_merge( $wgMimeTypeExclusions, $wgMimeTypeBlacklist );
292 } else {
293  $wgMimeTypeBlacklist = $wgMimeTypeExclusions;
294 }
295 if ( isset( $wgEnableUserEmailBlacklist ) ) {
296  $wgEnableUserEmailMuteList = $wgEnableUserEmailBlacklist;
297 } else {
298  $wgEnableUserEmailBlacklist = $wgEnableUserEmailMuteList;
299 }
300 if ( isset( $wgShortPagesNamespaceBlacklist ) ) {
301  $wgShortPagesNamespaceExclusions = $wgShortPagesNamespaceBlacklist;
302 } else {
303  $wgShortPagesNamespaceBlacklist = $wgShortPagesNamespaceExclusions;
304 }
305 
306 // Prohibited file extensions shouldn't appear on the "allowed" list
308 
309 // Fix path to icon images after they were moved in 1.24
310 if ( $wgRightsIcon ) {
311  $wgRightsIcon = str_replace(
312  "{$wgStylePath}/common/images/",
313  "{$wgResourceBasePath}/resources/assets/licenses/",
315  );
316 }
317 
318 if ( isset( $wgFooterIcons['copyright']['copyright'] )
319  && $wgFooterIcons['copyright']['copyright'] === []
320 ) {
321  if ( $wgRightsIcon || $wgRightsText ) {
322  $wgFooterIcons['copyright']['copyright'] = [
323  'url' => $wgRightsUrl,
324  'src' => $wgRightsIcon,
325  'alt' => $wgRightsText,
326  ];
327  }
328 }
329 
330 if ( isset( $wgFooterIcons['poweredby'] )
331  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
332  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
333 ) {
334  $wgFooterIcons['poweredby']['mediawiki']['src'] =
335  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
336  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
337  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
338  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
339 }
340 
349 
354  'name' => 'fsLockManager',
355  'class' => FSLockManager::class,
356  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
357 ];
358 $wgLockManagers[] = [
359  'name' => 'nullLockManager',
360  'class' => NullLockManager::class,
361 ];
362 
368  'imagesPerRow' => 0,
369  'imageWidth' => 120,
370  'imageHeight' => 120,
371  'captionLength' => true,
372  'showBytes' => true,
373  'showDimensions' => true,
374  'mode' => 'traditional',
375 ];
376 
380 if ( !$wgLocalFileRepo ) {
381  $wgLocalFileRepo = [
382  'class' => LocalRepo::class,
383  'name' => 'local',
384  'directory' => $wgUploadDirectory,
385  'scriptDirUrl' => $wgScriptPath,
387  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
388  'thumbScriptUrl' => $wgThumbnailScriptPath,
389  'transformVia404' => !$wgGenerateThumbnailOnParse,
390  'deletedDir' => $wgDeletedDirectory,
391  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0,
392  'updateCompatibleMetadata' => $wgUpdateCompatibleMetadata,
393  'reserializeMetadata' => $wgUpdateCompatibleMetadata,
394  ];
395 }
396 
397 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
398  // Create a default FileBackend name.
399  // FileBackendGroup will register a default, if absent from $wgFileBackends.
400  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
401 }
402 
406 if ( $wgUseSharedUploads ) {
407  if ( $wgSharedUploadDBname ) {
408  $wgForeignFileRepos[] = [
409  'class' => ForeignDBRepo::class,
410  'name' => 'shared',
411  'directory' => $wgSharedUploadDirectory,
412  'url' => $wgSharedUploadPath,
413  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
414  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
415  'transformVia404' => !$wgGenerateThumbnailOnParse,
416  'dbType' => $wgDBtype,
417  'dbServer' => $wgDBserver,
418  'dbUser' => $wgDBuser,
419  'dbPassword' => $wgDBpassword,
420  'dbName' => $wgSharedUploadDBname,
421  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
422  'tablePrefix' => $wgSharedUploadDBprefix,
423  'hasSharedCache' => $wgCacheSharedUploads,
424  'descBaseUrl' => $wgRepositoryBaseUrl,
425  'fetchDescription' => $wgFetchCommonsDescriptions,
426  ];
427  } else {
428  $wgForeignFileRepos[] = [
429  'class' => FileRepo::class,
430  'name' => 'shared',
431  'directory' => $wgSharedUploadDirectory,
432  'url' => $wgSharedUploadPath,
433  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
434  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
435  'transformVia404' => !$wgGenerateThumbnailOnParse,
436  'descBaseUrl' => $wgRepositoryBaseUrl,
437  'fetchDescription' => $wgFetchCommonsDescriptions,
438  ];
439  }
440 }
441 if ( $wgUseInstantCommons ) {
442  $wgForeignFileRepos[] = [
443  'class' => ForeignAPIRepo::class,
444  'name' => 'wikimediacommons',
445  'apibase' => 'https://commons.wikimedia.org/w/api.php',
446  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
447  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
448  'hashLevels' => 2,
449  'transformVia404' => true,
450  'fetchDescription' => true,
451  'descriptionCacheExpiry' => 43200,
452  'apiThumbCacheExpiry' => 0,
453  ];
454 }
455 foreach ( $wgForeignFileRepos as &$repo ) {
456  if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
457  $repo['directory'] = $wgUploadDirectory; // b/c
458  }
459  if ( !isset( $repo['backend'] ) ) {
460  $repo['backend'] = $repo['name'] . '-backend';
461  }
462 }
463 unset( $repo ); // no global pollution; destroy reference
464 
465 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
466 // Ensure that default user options are not invalid, since that breaks Special:Preferences
467 $wgDefaultUserOptions['rcdays'] = min(
468  $wgDefaultUserOptions['rcdays'],
469  ceil( $rcMaxAgeDays )
470 );
471 $wgDefaultUserOptions['watchlistdays'] = min(
472  $wgDefaultUserOptions['watchlistdays'],
473  ceil( $rcMaxAgeDays )
474 );
475 unset( $rcMaxAgeDays );
476 
477 if ( !$wgCookiePrefix ) {
478  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
480  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
482  } elseif ( $wgDBprefix ) {
484  } else {
486  }
487 }
488 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
489 
490 if ( $wgEnableEmail ) {
492 } else {
493  // Disable all other email settings automatically if $wgEnableEmail
494  // is set to false. - T65678
495  $wgAllowHTMLEmail = false;
496  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
506  unset( $wgGroupPermissions['user']['sendemail'] );
507  $wgUseEnotif = false;
510 }
511 
512 if ( $wgLocaltimezone === null ) {
513  // This defaults to the `date.timezone` value of the PHP INI option. If this option is not set,
514  // it falls back to UTC. Prior to PHP 7.0, this fallback produced a warning.
515  $wgLocaltimezone = date_default_timezone_get();
516 }
517 date_default_timezone_set( $wgLocaltimezone );
518 if ( $wgLocalTZoffset === null ) {
519  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
520 }
521 // The part after the System| is ignored, but rest of MW fills it out as the local offset.
522 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
523 
524 if ( !$wgDBerrorLogTZ ) {
526 }
527 
533 
534 // @todo UGLY UGLY
535 if ( is_array( $wgExtraNamespaces ) ) {
537 }
538 
539 // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php
540 if ( count( $wgDummyLanguageCodes ) !== 0 ) {
541  wfDeprecated( '$wgDummyLanguageCodes', '1.29' );
542 }
543 // Merge in the legacy language codes, incorporating overrides from the config
545  // Internal language codes of the private-use area which get mapped to
546  // themselves.
547  'qqq' => 'qqq', // Used for message documentation
548  'qqx' => 'qqx', // Used for viewing message keys
550 // Merge in (inverted) BCP 47 mappings
551 foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) {
552  $bcp47 = strtolower( $bcp47 ); // force case-insensitivity
553  if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) {
554  $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code;
555  }
556 }
557 unset( $code ); // no global pollution; destroy reference
558 unset( $bcp47 ); // no global pollution; destroy reference
559 
560 // Temporary backwards-compatibility reading of old replica lag settings as of MediaWiki 1.36,
561 // to support sysadmins who fail to update their settings immediately:
562 
563 if ( isset( $wgSlaveLagWarning ) ) {
564  // If the old value is set to something other than the default, use it.
565  if ( $wgDatabaseReplicaLagWarning === 10 && $wgSlaveLagWarning !== 10 ) {
566  $wgDatabaseReplicaLagWarning = $wgSlaveLagWarning;
567  wfDeprecated(
568  '$wgSlaveLagWarning set but $wgDatabaseReplicaLagWarning unchanged; using $wgSlaveLagWarning',
569  '1.36'
570  );
571  }
572 } else {
573  // Backwards-compatibility for extensions that read this value.
574  $wgSlaveLagWarning = $wgDatabaseReplicaLagWarning;
575 }
576 
577 if ( isset( $wgSlaveLagCritical ) ) {
578  // If the old value is set to something other than the default, use it.
579  if ( $wgDatabaseReplicaLagCritical === 30 && $wgSlaveLagCritical !== 30 ) {
580  $wgDatabaseReplicaLagCritical = $wgSlaveLagCritical;
581  wfDeprecated(
582  '$wgSlaveLagCritical set but $wgDatabaseReplicaLagCritical unchanged; using $wgSlaveLagCritical',
583  '1.36'
584  );
585  }
586 } else {
587  // Backwards-compatibility for extensions that read this value.
588  $wgSlaveLagCritical = $wgDatabaseReplicaLagCritical;
589 }
590 
591 if ( $wgInvalidateCacheOnLocalSettingsChange && defined( 'MW_CONFIG_FILE' ) ) {
592  Wikimedia\suppressWarnings();
593  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( MW_CONFIG_FILE ) ) );
594  Wikimedia\restoreWarnings();
595 }
596 
597 if ( $wgNewUserLog ) {
598  // Add new user log type
599  $wgLogTypes[] = 'newusers';
600  $wgLogNames['newusers'] = 'newuserlogpage';
601  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
602  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
603  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
604  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
605  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
606  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
607 }
608 
609 if ( $wgPageCreationLog ) {
610  // Add page creation log type
611  $wgLogTypes[] = 'create';
612  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
613 }
614 
615 if ( $wgPageLanguageUseDB ) {
616  $wgLogTypes[] = 'pagelang';
617  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
618 }
619 
620 if ( $wgCookieSecure === 'detect' ) {
622 }
623 
624 // Backwards compatibility with old password limits
625 if ( $wgMinimalPasswordLength !== false ) {
626  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
627 }
628 
629 if ( $wgMaximalPasswordLength !== false ) {
630  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
631 }
632 
633 if ( $wgPHPSessionHandling !== 'enable' &&
634  $wgPHPSessionHandling !== 'warn' &&
635  $wgPHPSessionHandling !== 'disable'
636 ) {
637  $wgPHPSessionHandling = 'warn';
638 }
639 if ( defined( 'MW_NO_SESSION' ) ) {
640  // If the entry point wants no session, force 'disable' here unless they
641  // specifically set it to the (undocumented) 'warn'.
642  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
643 }
644 
646 
647 // Enable the global service locator.
648 // Trivial expansion of site configuration should go before this point.
649 // Any non-trivial expansion that requires calling into MediaWikiServices or other parts of MW.
650 MediaWikiServices::allowGlobalInstance();
651 
652 // Define a constant that indicates that the bootstrapping of the service locator
653 // is complete.
654 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
655 
657 
658 // Non-trivial validation of: $wgServer
659 // The FatalError page only renders cleanly after MWExceptionHandler is installed.
660 if ( $wgServer === false ) {
661  // T30798: $wgServer must be explicitly set
662  throw new FatalError(
663  '$wgServer must be set in LocalSettings.php. ' .
664  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
665  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
666  );
667 }
668 
669 // Non-trivial expansion of: $wgCanonicalServer, $wgServerName.
670 // These require calling global functions.
671 // Also here are other settings that further depend on these two.
672 if ( $wgCanonicalServer === false ) {
674 }
676 
678 if ( $wgServerName !== false ) {
679  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
680  . 'not customized. Overwriting $wgServerName.' );
681 }
683 unset( $serverParts );
684 
685 // $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
686 if ( !$wgEmergencyContact ) {
687  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
688 }
689 if ( !$wgPasswordSender ) {
690  $wgPasswordSender = 'apache@' . $wgServerName;
691 }
692 if ( !$wgNoReplyAddress ) {
694 }
695 
696 // Non-trivial expansion of: $wgSecureLogin
697 // (due to calling wfWarn).
698 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
699  $wgSecureLogin = false;
700  wfWarn( 'Secure login was enabled on a server that only supports '
701  . 'HTTP or HTTPS. Disabling secure login.' );
702 }
703 
704 // Now that GlobalFunctions is loaded, set defaults that depend on it.
705 if ( $wgTmpDirectory === false ) {
707 }
708 
709 if ( $wgSharedDB && $wgSharedTables ) {
710  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
711  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
712  array_fill_keys(
714  [
715  'dbname' => $wgSharedDB,
716  'schema' => $wgSharedSchema,
717  'prefix' => $wgSharedPrefix
718  ]
719  )
720  );
721 }
722 
723 // Raise the memory limit if it's too low
724 // NOTE: This use wfDebug, and must remain after the MWDebug::setup() call.
726 
727 // Initialize the request object in $wgRequest
728 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
729 
730 // Make sure that object caching does not undermine the ChronologyProtector improvements
731 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
732  // The user is pinned to the primary DC, meaning that they made recent changes which should
733  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
734  // they use a blind TTL and could be stale if an object changes twice in a short time span.
735  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
736 }
737 
738 // Useful debug output
739 ( static function () {
741  $logger = LoggerFactory::getInstance( 'wfDebug' );
742  if ( $wgCommandLineMode ) {
743  $self = $_SERVER['PHP_SELF'] ?? '';
744  $logger->debug( "\n\nStart command line script $self" );
745  } else {
746  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
747  $debug .= "IP: " . $wgRequest->getIP() . "\n";
748  $debug .= "HTTP HEADERS:\n";
749  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
750  $debug .= "$name: $value\n";
751  }
752  $debug .= "(end headers)";
753  $logger->debug( $debug );
754  }
755 } )();
756 
757 // Most of the config is out, some might want to run hooks here.
758 Hooks::runner()->onSetupAfterCache();
759 
760 // Now that variant lists may be available, parse any action paths and article paths
761 // as query parameters.
762 //
763 // Skip title interpolation on API queries where it is useless and sometimes harmful (T18019).
764 //
765 // Optimization: Skip on load.php and all other entrypoints besides index.php to save time.
766 //
767 // TODO: Figure out if this can be safely done after everything else in Setup.php (e.g. any
768 // hooks or other state that would miss this?). If so, move to wfIndexMain or MediaWiki::run.
769 if ( MW_ENTRY_POINT === 'index' ) {
770  $wgRequest->interpolateTitle();
771 }
772 
777 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
778  // If session.auto_start is there, we can't touch session name
779  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
780  HeaderCallback::warnIfHeadersSent();
781  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
782  }
783 
784  // Create the SessionManager singleton and set up our session handler,
785  // unless we're specifically asked not to.
786  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
788  MediaWiki\Session\SessionManager::singleton()
789  );
790  }
791 
792  $contLang = MediaWikiServices::getInstance()->getContentLanguage();
793 
794  // Initialize the session
795  try {
797  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
798  // The exception is because the request had multiple possible
799  // sessions tied for top priority. Report this to the user.
800  $list = [];
801  foreach ( $ex->getSessionInfos() as $info ) {
802  $list[] = $info->getProvider()->describe( $contLang );
803  }
804  $list = $contLang->listToText( $list );
805  throw new HttpError( 400,
806  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $contLang )
807  );
808  }
809 
810  unset( $contLang );
811 
812  if ( $session->isPersistent() ) {
813  $wgInitialSessionId = $session->getSessionId();
814  }
815 
816  $session->renew();
817  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
818  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
819  session_id() !== $session->getId()
820  ) {
821  // Start the PHP-session for backwards compatibility
822  if ( session_id() !== '' ) {
823  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
824  'old_id' => session_id(),
825  'new_id' => $session->getId(),
826  ] );
827  session_write_close();
828  }
829  session_id( $session->getId() );
830  session_start();
831  }
832 
833  unset( $session );
834 } else {
835  // Even if we didn't set up a global Session, still install our session
836  // handler unless specifically requested not to.
837  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
839  MediaWiki\Session\SessionManager::singleton()
840  );
841  }
842 }
843 
849 $wgUser = new StubGlobalUser( RequestContext::getMain()->getUser() ); // BackCompat
850 register_shutdown_function( static function () {
852 } );
853 
858 
862 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
863 
868 $wgParser = new DeprecatedGlobal( 'wgParser', static function () {
869  return MediaWikiServices::getInstance()->getParser();
870 }, '1.32' );
871 
875 $wgTitle = null;
876 
877 // Extension setup functions
878 // Entries should be added to this variable during the inclusion
879 // of the extension file. This allows the extension to perform
880 // any necessary initialisation in the fully initialised environment
881 foreach ( $wgExtensionFunctions as $func ) {
882  call_user_func( $func );
883 }
884 unset( $func ); // no global pollution; destroy reference
885 
886 // If the session user has a 0 id but a valid name, that means we need to
887 // autocreate it.
888 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
889  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
890  if ( $sessionUser->getId() === 0 &&
891  MediaWikiServices::getInstance()->getUserNameUtils()->isValid( $sessionUser->getName() )
892  ) {
893  $res = MediaWikiServices::getInstance()->getAuthManager()->autoCreateUser(
894  $sessionUser,
895  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
896  true
897  );
898  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
899  'event' => 'autocreate',
900  'status' => strval( $res ),
901  ] );
902  unset( $res );
903  }
904  unset( $sessionUser );
905 }
906 
907 if ( !$wgCommandLineMode ) {
909 }
910 
912 
913 // T264370
914 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
915  MediaWiki\Session\SessionManager::singleton()->logPotentialSessionLeakage();
916 }
$wgSharedUploadDirectory
string $wgSharedUploadDirectory
Shortcut for the 'directory' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:770
LanguageCode\getDeprecatedCodeMapping
static getDeprecatedCodeMapping()
Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up...
Definition: LanguageCode.php:124
$wgUpdateCompatibleMetadata
$wgUpdateCompatibleMetadata
Shortcut for the 'updateCompatibleMetadata' setting of $wgLocalFileRepo.
Definition: DefaultSettings.php:974
MediaWiki\Session\PHPSessionHandler\install
static install(SessionManager $manager)
Install a session handler for the current web request.
Definition: PHPSessionHandler.php:111
$wgUsersNotifiedOnAllChanges
$wgUsersNotifiedOnAllChanges
Definition: Setup.php:509
StubGlobalUser\$destructorDeprecationDisarmed
static bool $destructorDeprecationDisarmed
Definition: StubGlobalUser.php:34
$wgMaximalPasswordLength
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
Definition: DefaultSettings.php:5512
MW_NO_SESSION
const MW_NO_SESSION
Definition: load.php:32
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:2090
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:72
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:9105
$wgParser
$wgParser
Definition: Setup.php:868
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:498
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:3177
$wgRestPath
$wgRestPath
The URL path to the REST API Defaults to "{$wgScriptPath}/rest.php".
Definition: DefaultSettings.php:219
$wgGalleryOptions
$wgGalleryOptions
Default parameters for the "<gallery>" tag.
Definition: Setup.php:367
$wgTmpDirectory
$wgTmpDirectory
The local filesystem path to a temporary directory.
Definition: DefaultSettings.php:452
$wgRightsText
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
Definition: DefaultSettings.php:8300
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:2065
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:467
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:505
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2230
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:202
$wgSharedSchema
$wgSharedSchema
Definition: DefaultSettings.php:2236
$wgRequest
$wgRequest
Definition: Setup.php:728
$wgFileExtensions
$wgFileExtensions
Definition: Setup.php:307
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:8959
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:508
$wgScript
$wgScript
The URL path to index.php.
Definition: DefaultSettings.php:204
MediaWiki\Logger\LoggerFactory\getInstance
static getInstance( $channel)
Get a named logger instance from the currently configured logger factory.
Definition: LoggerFactory.php:92
$wgDBtype
$wgDBtype
Database type.
Definition: DefaultSettings.php:2110
$wgSharedDB
$wgSharedDB
Shared database for multiple wikis.
Definition: DefaultSettings.php:2219
$wgProhibitedFileExtensions
$wgProhibitedFileExtensions
Files with these extensions will never be allowed as uploads.
Definition: DefaultSettings.php:1119
$wgLocalFileRepo
$wgLocalFileRepo
File repository structures.
Definition: DefaultSettings.php:705
$wgWANObjectCaches
$wgWANObjectCaches
Advanced WAN object cache configuration.
Definition: DefaultSettings.php:2900
$wgSharedUploadDBname
bool string $wgSharedUploadDBname
Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:815
DBO_DEBUG
const DBO_DEBUG
Definition: defines.php:9
wfMemoryLimit
wfMemoryLimit( $newLimit)
Raise PHP's memory limit (if needed).
Definition: GlobalFunctions.php:2365
$wgDBmwschema
$wgDBmwschema
Current wiki database schema name.
Definition: DefaultSettings.php:2075
$wgNamespaceProtection
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:348
$wgEnableUserEmail
$wgEnableUserEmail
Definition: Setup.php:497
$wgRequestTimeLimit
int null $wgRequestTimeLimit
Set a limit on server request wall clock time.
Definition: DefaultSettings.php:2596
NamespaceInfo\CANONICAL_NAMES
const CANONICAL_NAMES
Definitions of the NS_ constants are in Defines.php.
Definition: NamespaceInfo.php:64
$wgExtensionAssetsPath
$wgExtensionAssetsPath
The URL path of the extensions directory.
Definition: DefaultSettings.php:241
$serverParts
$serverParts
Definition: Setup.php:677
MWExceptionHandler\installHandler
static installHandler()
Install handlers with PHP.
Definition: MWExceptionHandler.php:67
WebRequest\detectProtocol
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:303
$wgShortPagesNamespaceExclusions
$wgShortPagesNamespaceExclusions
Optional array of namespaces which should be excluded from Special:ShortPages.
Definition: DefaultSettings.php:4700
$wgScopeTest
if(!defined( 'MEDIAWIKI')) $wgScopeTest
Environment checks.
Definition: Setup.php:75
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2744
$wgVirtualRestConfig
if( $wgServer===false) if( $wgCanonicalServer===false) $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:675
$res
$res
Definition: testCompression.php:57
$wgSharedThumbnailScriptPath
string $wgSharedThumbnailScriptPath
Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:1092
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:312
$wgLang
$wgLang
Definition: Setup.php:857
wfDebugLog
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Definition: GlobalFunctions.php:958
$wgMetaNamespace
$wgMetaNamespace
Name of the project namespace.
Definition: DefaultSettings.php:4539
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:32
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:2105
$wgDBprefix
$wgDBprefix
Current wiki database table name prefix.
Definition: DefaultSettings.php:2085
$wgFetchCommonsDescriptions
bool $wgFetchCommonsDescriptions
Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:805
$wgStylePath
$wgStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:226
$debug
$debug
Definition: mcc.php:31
$wgRepositoryBaseUrl
$wgRepositoryBaseUrl
Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:796
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:465
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:731
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:134
$wgCanonicalNamespaceNames
if(! $wgDBerrorLogTZ) $wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:532
wfParseUrl
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
Definition: GlobalFunctions.php:776
$wgHashedSharedUploadDirectory
bool $wgHashedSharedUploadDirectory
Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:788
$wgNoReplyAddress
$wgNoReplyAddress
Reply-To address for e-mail notifications.
Definition: DefaultSettings.php:1853
$wgEnotifMaxRecips
$wgEnotifMaxRecips
Definition: Setup.php:500
MediaWiki\Settings\Config\GlobalConfigBuilder
Definition: GlobalConfigBuilder.php:8
$wgEmergencyContact
$wgEmergencyContact
Site admin email address.
Definition: DefaultSettings.php:1836
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Definition: GlobalFunctions.php:997
MediaWiki\Logger\LoggerFactory
PSR-3 logger instance factory.
Definition: LoggerFactory.php:45
$wgFooterIcons
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
Definition: DefaultSettings.php:3919
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2763
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:29
$wgFullyInitialised
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition: Setup.php:911
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:544
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:28
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:504
$wgLoadScript
$wgLoadScript
The URL path to load.php.
Definition: DefaultSettings.php:212
MediaWiki
A helper class for throttling authentication attempts.
$wgEnableUserEmailMuteList
$wgEnableUserEmailMuteList
Set to true to enable user-to-user e-mail mutelist.
Definition: DefaultSettings.php:1883
$wgSharedPrefix
$wgSharedPrefix
Definition: DefaultSettings.php:2224
MediaWiki\Session\SessionManager\singleton
static singleton()
Get the global SessionManager.
Definition: SessionManager.php:133
$wgLogTypes
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
Definition: DefaultSettings.php:8874
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:503
$wgSettings
if(is_readable("$IP/vendor/autoload.php")) elseif(file_exists("$IP/vendor/autoload.php")) if(!interface_exists(LoggerInterface::class)) global $wgSettings
Definition: Setup.php:116
$wgEnableEmail
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
Definition: DefaultSettings.php:1860
$wgLogos
array false $wgLogos
Specification for different versions of the wiki logo.
Definition: DefaultSettings.php:364
$wgCookiePrefix
if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:488
$wgSessionName
$wgSessionName
Override to customise the session name.
Definition: DefaultSettings.php:7158
MWDebug\setup
static setup()
Definition: MWDebug.php:80
$wgMimeTypeExclusions
$wgMimeTypeExclusions
Files with these MIME types will never be allowed as uploads if $wgVerifyMimeType is enabled.
Definition: DefaultSettings.php:1136
$wgCanonicalServer
$wgCanonicalServer
Canonical URL of the server, to use in IRC feeds and notification e-mails.
Definition: DefaultSettings.php:117
$wgHashedUploadDirectory
bool $wgHashedUploadDirectory
Shortcut for setting hashLevels=2 in $wgLocalFileRepo.
Definition: DefaultSettings.php:1100
$wgEnotifRevealEditorAddress
$wgEnotifRevealEditorAddress
Definition: Setup.php:502
$wgMemoryLimit
$wgMemoryLimit
The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit i...
Definition: DefaultSettings.php:2665
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:353
$wgDatabaseReplicaLagWarning
$wgDatabaseReplicaLagWarning
If lag is higher than $wgDatabaseReplicaLagWarning, show a warning in some special pages (like watchl...
Definition: DefaultSettings.php:2364
$wgTitle
$wgTitle
Definition: Setup.php:875
$wgUseSharedUploads
bool $wgUseSharedUploads
Shortcut for adding an entry to $wgForeignFileRepos.
Definition: DefaultSettings.php:761
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:2557
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:501
MediaWiki\Session\SessionManager\getGlobalSession
static getGlobalSession()
If PHP's session_id() has been set, returns that session.
Definition: SessionManager.php:146
$wgLocalTZoffset
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
Definition: DefaultSettings.php:3710
$wgForceHTTPS
bool $wgForceHTTPS
If this is true, when an insecure HTTP request is received, always redirect to HTTPS.
Definition: DefaultSettings.php:165
$wgDeletedDirectory
$wgDeletedDirectory
What directory to place deleted uploads in.
Definition: DefaultSettings.php:550
$wgCacheSharedUploads
bool $wgCacheSharedUploads
Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:833
StubUserLang
Stub object for the user language.
Definition: StubUserLang.php:24
MediaWiki\HeaderCallback
Definition: HeaderCallback.php:8
$wgServer
$wgServer
URL of the server.
Definition: DefaultSettings.php:108
DeprecatedGlobal
Class to allow throwing wfDeprecated warnings when people use globals that we do not want them to.
Definition: DeprecatedGlobal.php:27
Hooks\runner
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
Definition: Hooks.php:173
$wgRCMaxAge
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
Definition: DefaultSettings.php:7884
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:80
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:8305
MediaWiki\Settings\Config\PhpIniSink
Definition: PhpIniSink.php:10
$wgExtensionFunctions
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
Definition: DefaultSettings.php:8432
$wgEmailAuthentication
$wgEmailAuthentication
Definition: Setup.php:496
$wgUploadBaseUrl
$wgUploadBaseUrl
If set, this URL is added to the start of $wgUploadPath to form a complete upload URL.
Definition: DefaultSettings.php:459
$wgUploadDirectory
$wgUploadDirectory
The filesystem path of the images directory.
Definition: DefaultSettings.php:297
$wgAllowHTMLEmail
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
Definition: DefaultSettings.php:1952
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:484
$wgLogActionsHandlers
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
Definition: DefaultSettings.php:8987
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:1844
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:4412
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:507
$wgArticlePath
$wgArticlePath
The URL path for primary article page views.
Definition: DefaultSettings.php:264
$self
$self
Definition: doMaintenance.php:63
$wgCacheEpoch
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
Definition: DefaultSettings.php:3108
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:3114
Message\newFromKey
static newFromKey( $key,... $params)
Factory function that is just wrapper for the real constructor.
Definition: Message.php:381
wfTempDir
wfTempDir()
Tries to get the system directory for temporary files.
Definition: GlobalFunctions.php:1728
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:7835
$wgThumbnailScriptPath
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
Definition: DefaultSettings.php:1083
$wgInitialSessionId
if(MW_ENTRY_POINT==='index') MediaWiki Session SessionId null $wgInitialSessionId
The persistent session ID (if any) loaded at startup.
Definition: Setup.php:776
$wgGroupPermissions
$wgGroupPermissions
Permission keys given to users in each group.
Definition: DefaultSettings.php:5951
FatalError
Abort the web request with a custom HTML string that will represent the entire response.
Definition: FatalError.php:37
$wgLocaltimezone
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Definition: DefaultSettings.php:3699
$wgEnotifImpersonal
$wgEnotifImpersonal
Definition: Setup.php:499
$wgSharedUploadDBprefix
string $wgSharedUploadDBprefix
Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:824
$wgCookieSecure
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
Definition: DefaultSettings.php:7104
StubGlobalUser
Stub object for the global user ($wgUser) that makes it possible to change the relevant underlying ob...
Definition: StubGlobalUser.php:31
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:8936
$wgFileCacheDirectory
$wgFileCacheDirectory
Directory where the cached page will be saved.
Definition: DefaultSettings.php:303
$wgUploadPath
$wgUploadPath
The URL path for the images directory.
Definition: DefaultSettings.php:270
wfWarn
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
Definition: GlobalFunctions.php:1043
$wgDBuser
$wgDBuser
Database username.
Definition: DefaultSettings.php:2100
$wgDBerrorLogTZ
$wgDBerrorLogTZ
Timezone to use in the error log.
Definition: DefaultSettings.php:2340
$wgPasswordPolicy
$wgPasswordPolicy
Password policy for the wiki.
Definition: DefaultSettings.php:5267
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:7228
Pingback\schedulePingback
static schedulePingback()
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send...
Definition: Pingback.php:290
$wgMinimalPasswordLength
$wgMinimalPasswordLength
Specifies the minimal length of a user password.
Definition: DefaultSettings.php:5499
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:682
$wgOut
$wgOut
Definition: Setup.php:862
$wgPasswordSender
$wgPasswordSender
Sender email address for e-mail notifications.
Definition: DefaultSettings.php:1846
$wgPHPSessionHandling
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
Definition: DefaultSettings.php:2999
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3503
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:176
DBO_DEFAULT
const DBO_DEFAULT
Definition: defines.php:13
$IP
$IP
Definition: WebStart.php:49
LanguageCode\getNonstandardLanguageCodeMapping
static getNonstandardLanguageCodeMapping()
Returns a mapping of non-standard language codes used by (current and previous version of) MediaWiki,...
Definition: LanguageCode.php:140
$wgForeignFileRepos
$wgForeignFileRepos
Enable the use of files from one or more other wikis.
Definition: DefaultSettings.php:720
$wgLocalStylePath
$wgLocalStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:234
$wgSecureLogin
$wgSecureLogin
This is to let user authenticate using https when they come from http.
Definition: DefaultSettings.php:5762
$wgGenerateThumbnailOnParse
bool $wgGenerateThumbnailOnParse
Render thumbnails while parsing wikitext.
Definition: DefaultSettings.php:1494
MediaWiki\Settings\SettingsBuilder
Utility for loading settings files.
Definition: SettingsBuilder.php:23
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:4583
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:9099
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2873
$wgDatabaseReplicaLagCritical
$wgDatabaseReplicaLagCritical
Definition: DefaultSettings.php:2371
MW_ENTRY_POINT
const MW_ENTRY_POINT
Definition: api.php:41
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:192
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:474
$wgRightsUrl
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki.
Definition: DefaultSettings.php:8292
$wgUsePathInfo
$wgUsePathInfo
Whether to support URLs like index.php/Page_title These often break when PHP is set up in CGI mode.
Definition: DefaultSettings.php:195
$wgSharedUploadPath
string $wgSharedUploadPath
Shortcut for the 'url' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:779