MediaWiki  master
Setup.php
Go to the documentation of this file.
1 <?php
53 use Psr\Log\LoggerInterface;
54 use Wikimedia\RequestTimeout\RequestTimeout;
55 
63 // This file must be included from a valid entry point (e.g. WebStart.php, Maintenance.php)
64 if ( !defined( 'MEDIAWIKI' ) ) {
65  exit( 1 );
66 }
67 
68 // This file must have global scope.
69 $wgScopeTest = 'MediaWiki Setup.php scope test';
70 if ( !isset( $GLOBALS['wgScopeTest'] ) || $GLOBALS['wgScopeTest'] !== $wgScopeTest ) {
71  echo "Error, Setup.php must be included from the file scope.\n";
72  die( 1 );
73 }
74 unset( $wgScopeTest );
75 
76 // PHP must not be configured to overload mbstring functions. (T5782, T122807)
77 // This was deprecated by upstream in PHP 7.2, likely to be removed in PHP 8.0.
78 if ( ini_get( 'mbstring.func_overload' ) ) {
79  die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
80 }
81 
82 // The MW_ENTRY_POINT constant must always exists, to make it safe to access.
83 // For compat, we do support older and custom MW entryoints that don't set this,
84 // in which case we assign a default here.
85 if ( !defined( 'MW_ENTRY_POINT' ) ) {
91  define( 'MW_ENTRY_POINT', 'unknown' );
92 }
93 
100 require_once "$IP/includes/AutoLoader.php";
101 require_once "$IP/includes/Defines.php";
102 require_once "$IP/includes/DefaultSettings.php";
103 require_once "$IP/includes/GlobalFunctions.php";
104 
105 // Load composer's autoloader if present
106 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
107  require_once "$IP/vendor/autoload.php";
108 } elseif ( file_exists( "$IP/vendor/autoload.php" ) ) {
109  die( "$IP/vendor/autoload.php exists but is not readable" );
110 }
111 
112 // Assert that composer dependencies were successfully loaded
113 if ( !interface_exists( LoggerInterface::class ) ) {
114  $message = (
115  'MediaWiki requires the <a href="https://github.com/php-fig/log">PSR-3 logging ' .
116  "library</a> to be present. This library is not embedded directly in MediaWiki's " .
117  "git repository and must be installed separately by the end user.\n\n" .
118  'Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git' .
119  '#Fetch_external_libraries">mediawiki.org</a> for help on installing ' .
120  'the required components.'
121  );
122  echo $message;
123  trigger_error( $message, E_USER_ERROR );
124  die( 1 );
125 }
126 
127 HeaderCallback::register();
128 
129 // Set the encoding used by PHP for reading HTTP input, and writing output.
130 // This is also the default for mbstring functions.
131 mb_internal_encoding( 'UTF-8' );
132 
137 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
138  call_user_func( MW_CONFIG_CALLBACK );
139 } else {
140  if ( !defined( 'MW_CONFIG_FILE' ) ) {
141  define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
142  }
143  require_once MW_CONFIG_FILE;
144 }
145 
153 if ( defined( 'MW_SETUP_CALLBACK' ) ) {
154  call_user_func( MW_SETUP_CALLBACK );
155 }
156 
157 // Start time limit
159  RequestTimeout::singleton()->setWallTimeLimit( $wgRequestTimeLimit );
160 }
161 
166 ExtensionRegistry::getInstance()->loadFromQueue();
167 // Don't let any other extensions load
169 
170 // Set the configured locale on all requests for consistency
171 // This must be after LocalSettings.php (and is informed by the installer).
172 putenv( "LC_ALL=$wgShellLocale" );
173 setlocale( LC_ALL, $wgShellLocale );
174 
179 if ( $wgScript === false ) {
180  $wgScript = "$wgScriptPath/index.php";
181 }
182 if ( $wgLoadScript === false ) {
183  $wgLoadScript = "$wgScriptPath/load.php";
184 }
185 if ( $wgRestPath === false ) {
186  $wgRestPath = "$wgScriptPath/rest.php";
187 }
188 if ( $wgArticlePath === false ) {
189  if ( $wgUsePathInfo ) {
190  $wgArticlePath = "$wgScript/$1";
191  } else {
192  $wgArticlePath = "$wgScript?title=$1";
193  }
194 }
195 if ( $wgResourceBasePath === null ) {
197 }
198 if ( $wgStylePath === false ) {
199  $wgStylePath = "$wgResourceBasePath/skins";
200 }
201 if ( $wgLocalStylePath === false ) {
202  // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
203  $wgLocalStylePath = "$wgScriptPath/skins";
204 }
205 if ( $wgExtensionAssetsPath === false ) {
206  $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
207 }
208 
209 // For backwards compatibility, the value of wgLogos is copied to wgLogo.
210 // This is because some extensions/skins may be using $config->get('Logo')
211 // to access the value.
212 if ( $wgLogos !== false && isset( $wgLogos['1x'] ) ) {
213  $wgLogo = $wgLogos['1x'];
214 }
215 if ( $wgLogo === false ) {
216  $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
217 }
218 
219 if ( $wgUploadPath === false ) {
220  $wgUploadPath = "$wgScriptPath/images";
221 }
222 if ( $wgUploadDirectory === false ) {
223  $wgUploadDirectory = "$IP/images";
224 }
225 if ( $wgReadOnlyFile === false ) {
226  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
227 }
228 if ( $wgFileCacheDirectory === false ) {
229  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
230 }
231 if ( $wgDeletedDirectory === false ) {
232  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
233 }
234 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
235  $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
236 }
237 if ( $wgSharedPrefix === false ) {
239 }
240 if ( $wgSharedSchema === false ) {
242 }
243 if ( $wgMetaNamespace === false ) {
244  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
245 }
246 
247 // Blacklisted file extensions shouldn't appear on the "allowed" list
248 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
249 
250 // Fix path to icon images after they were moved in 1.24
251 if ( $wgRightsIcon ) {
252  $wgRightsIcon = str_replace(
253  "{$wgStylePath}/common/images/",
254  "{$wgResourceBasePath}/resources/assets/licenses/",
256  );
257 }
258 
259 if ( isset( $wgFooterIcons['copyright']['copyright'] )
260  && $wgFooterIcons['copyright']['copyright'] === []
261 ) {
262  if ( $wgRightsIcon || $wgRightsText ) {
263  $wgFooterIcons['copyright']['copyright'] = [
264  'url' => $wgRightsUrl,
265  'src' => $wgRightsIcon,
266  'alt' => $wgRightsText,
267  ];
268  }
269 }
270 
271 if ( isset( $wgFooterIcons['poweredby'] )
272  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
273  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
274 ) {
275  $wgFooterIcons['poweredby']['mediawiki']['src'] =
276  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
277  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
278  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
279  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
280 }
281 
290 
295  'name' => 'fsLockManager',
296  'class' => FSLockManager::class,
297  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
298 ];
299 $wgLockManagers[] = [
300  'name' => 'nullLockManager',
301  'class' => NullLockManager::class,
302 ];
303 
309  'imagesPerRow' => 0,
310  'imageWidth' => 120,
311  'imageHeight' => 120,
312  'captionLength' => true,
313  'showBytes' => true,
314  'showDimensions' => true,
315  'mode' => 'traditional',
316 ];
317 
321 if ( !$wgLocalFileRepo ) {
322  $wgLocalFileRepo = [
323  'class' => LocalRepo::class,
324  'name' => 'local',
325  'directory' => $wgUploadDirectory,
326  'scriptDirUrl' => $wgScriptPath,
328  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
329  'thumbScriptUrl' => $wgThumbnailScriptPath,
330  'transformVia404' => !$wgGenerateThumbnailOnParse,
331  'deletedDir' => $wgDeletedDirectory,
332  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0
333  ];
334 }
335 
336 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
337  // Create a default FileBackend name.
338  // FileBackendGroup will register a default, if absent from $wgFileBackends.
339  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
340 }
341 
345 if ( $wgUseSharedUploads ) {
346  if ( $wgSharedUploadDBname ) {
347  $wgForeignFileRepos[] = [
348  'class' => ForeignDBRepo::class,
349  'name' => 'shared',
350  'directory' => $wgSharedUploadDirectory,
351  'url' => $wgSharedUploadPath,
352  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
353  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
354  'transformVia404' => !$wgGenerateThumbnailOnParse,
355  'dbType' => $wgDBtype,
356  'dbServer' => $wgDBserver,
357  'dbUser' => $wgDBuser,
358  'dbPassword' => $wgDBpassword,
359  'dbName' => $wgSharedUploadDBname,
360  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
361  'tablePrefix' => $wgSharedUploadDBprefix,
362  'hasSharedCache' => $wgCacheSharedUploads,
363  'descBaseUrl' => $wgRepositoryBaseUrl,
364  'fetchDescription' => $wgFetchCommonsDescriptions,
365  ];
366  } else {
367  $wgForeignFileRepos[] = [
368  'class' => FileRepo::class,
369  'name' => 'shared',
370  'directory' => $wgSharedUploadDirectory,
371  'url' => $wgSharedUploadPath,
372  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
373  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
374  'transformVia404' => !$wgGenerateThumbnailOnParse,
375  'descBaseUrl' => $wgRepositoryBaseUrl,
376  'fetchDescription' => $wgFetchCommonsDescriptions,
377  ];
378  }
379 }
380 if ( $wgUseInstantCommons ) {
381  $wgForeignFileRepos[] = [
382  'class' => ForeignAPIRepo::class,
383  'name' => 'wikimediacommons',
384  'apibase' => 'https://commons.wikimedia.org/w/api.php',
385  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
386  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
387  'hashLevels' => 2,
388  'transformVia404' => true,
389  'fetchDescription' => true,
390  'descriptionCacheExpiry' => 43200,
391  'apiThumbCacheExpiry' => 0,
392  ];
393 }
394 foreach ( $wgForeignFileRepos as &$repo ) {
395  if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
396  $repo['directory'] = $wgUploadDirectory; // b/c
397  }
398  if ( !isset( $repo['backend'] ) ) {
399  $repo['backend'] = $repo['name'] . '-backend';
400  }
401 }
402 unset( $repo ); // no global pollution; destroy reference
403 
404 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
405 // Ensure that default user options are not invalid, since that breaks Special:Preferences
406 $wgDefaultUserOptions['rcdays'] = min(
407  $wgDefaultUserOptions['rcdays'],
408  ceil( $rcMaxAgeDays )
409 );
410 $wgDefaultUserOptions['watchlistdays'] = min(
411  $wgDefaultUserOptions['watchlistdays'],
412  ceil( $rcMaxAgeDays )
413 );
414 unset( $rcMaxAgeDays );
415 
416 if ( !$wgCookiePrefix ) {
417  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
419  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
421  } elseif ( $wgDBprefix ) {
423  } else {
425  }
426 }
427 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
428 
429 if ( $wgEnableEmail ) {
431 } else {
432  // Disable all other email settings automatically if $wgEnableEmail
433  // is set to false. - T65678
434  $wgAllowHTMLEmail = false;
435  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
445  unset( $wgGroupPermissions['user']['sendemail'] );
446  $wgUseEnotif = false;
449 }
450 
456 
457 // @todo UGLY UGLY
458 if ( is_array( $wgExtraNamespaces ) ) {
460 }
461 
462 // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php
463 if ( count( $wgDummyLanguageCodes ) !== 0 ) {
464  wfDeprecated( '$wgDummyLanguageCodes', '1.29' );
465 }
466 // Merge in the legacy language codes, incorporating overrides from the config
468  // Internal language codes of the private-use area which get mapped to
469  // themselves.
470  'qqq' => 'qqq', // Used for message documentation
471  'qqx' => 'qqx', // Used for viewing message keys
473 // Merge in (inverted) BCP 47 mappings
474 foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) {
475  $bcp47 = strtolower( $bcp47 ); // force case-insensitivity
476  if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) {
477  $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code;
478  }
479 }
480 unset( $code ); // no global pollution; destroy reference
481 unset( $bcp47 ); // no global pollution; destroy reference
482 
483 // Temporary backwards-compatibility reading of old replica lag settings as of MediaWiki 1.36,
484 // to support sysadmins who fail to update their settings immediately:
485 
486 if ( isset( $wgSlaveLagWarning ) ) {
487  // If the old value is set to something other than the default, use it.
488  if ( $wgDatabaseReplicaLagWarning === 10 && $wgSlaveLagWarning !== 10 ) {
489  $wgDatabaseReplicaLagWarning = $wgSlaveLagWarning;
490  wfDeprecated(
491  '$wgSlaveLagWarning set but $wgDatabaseReplicaLagWarning unchanged; using $wgSlaveLagWarning',
492  '1.36'
493  );
494  }
495 } else {
496  // Backwards-compatibility for extensions that read this value.
497  $wgSlaveLagWarning = $wgDatabaseReplicaLagWarning;
498 }
499 
500 if ( isset( $wgSlaveLagCritical ) ) {
501  // If the old value is set to something other than the default, use it.
502  if ( $wgDatabaseReplicaLagCritical === 30 && $wgSlaveLagCritical !== 30 ) {
503  $wgDatabaseReplicaLagCritical = $wgSlaveLagCritical;
504  wfDeprecated(
505  '$wgSlaveLagCritical set but $wgDatabaseReplicaLagCritical unchanged; using $wgSlaveLagCritical',
506  '1.36'
507  );
508  }
509 } else {
510  // Backwards-compatibility for extensions that read this value.
511  $wgSlaveLagCritical = $wgDatabaseReplicaLagCritical;
512 }
513 
515  Wikimedia\suppressWarnings();
516  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
517  Wikimedia\restoreWarnings();
518 }
519 
520 if ( $wgNewUserLog ) {
521  // Add new user log type
522  $wgLogTypes[] = 'newusers';
523  $wgLogNames['newusers'] = 'newuserlogpage';
524  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
525  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
526  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
527  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
528  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
529  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
530 }
531 
532 if ( $wgPageCreationLog ) {
533  // Add page creation log type
534  $wgLogTypes[] = 'create';
535  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
536 }
537 
538 if ( $wgPageLanguageUseDB ) {
539  $wgLogTypes[] = 'pagelang';
540  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
541 }
542 
543 if ( $wgCookieSecure === 'detect' ) {
545 }
546 
547 // Backwards compatibility with old password limits
548 if ( $wgMinimalPasswordLength !== false ) {
549  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
550 }
551 
552 if ( $wgMaximalPasswordLength !== false ) {
553  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
554 }
555 
556 if ( $wgPHPSessionHandling !== 'enable' &&
557  $wgPHPSessionHandling !== 'warn' &&
558  $wgPHPSessionHandling !== 'disable'
559 ) {
560  $wgPHPSessionHandling = 'warn';
561 }
562 if ( defined( 'MW_NO_SESSION' ) ) {
563  // If the entry point wants no session, force 'disable' here unless they
564  // specifically set it to the (undocumented) 'warn'.
565  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
566 }
567 
569 
570 // Enable the global service locator.
571 MediaWikiServices::allowGlobalInstance();
572 
573 // Define a constant that indicates that the bootstrapping of the service locator
574 // is complete.
575 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
576 
578 
579 // T30798: $wgServer must be explicitly set
580 // @phan-suppress-next-line PhanSuspiciousValueComparisonInGlobalScope
581 if ( $wgServer === false ) {
582  throw new FatalError(
583  '$wgServer must be set in LocalSettings.php. ' .
584  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
585  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
586  );
587 }
588 
589 if ( $wgCanonicalServer === false ) {
591 }
592 
593 // Set server name
595 if ( $wgServerName !== false ) {
596  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
597  . 'not customized. Overwriting $wgServerName.' );
598 }
600 unset( $serverParts );
601 
602 // Set defaults for configuration variables
603 // that are derived from the server name by default
604 // Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
605 if ( !$wgEmergencyContact ) {
606  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
607 }
608 if ( !$wgPasswordSender ) {
609  $wgPasswordSender = 'apache@' . $wgServerName;
610 }
611 if ( !$wgNoReplyAddress ) {
613 }
614 
615 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
616  $wgSecureLogin = false;
617  wfWarn( 'Secure login was enabled on a server that only supports '
618  . 'HTTP or HTTPS. Disabling secure login.' );
619 }
620 
622 
623 // Now that GlobalFunctions is loaded, set defaults that depend on it.
624 if ( $wgTmpDirectory === false ) {
626 }
627 
628 if ( $wgMainWANCache === false ) {
629  // Setup a WAN cache from $wgMainCacheType
630  $wgMainWANCache = 'mediawiki-main-default';
632  'class' => WANObjectCache::class,
633  'cacheId' => $wgMainCacheType,
634  ];
635 }
636 
637 if ( $wgSharedDB && $wgSharedTables ) {
638  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
639  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
640  array_fill_keys(
642  [
643  'dbname' => $wgSharedDB,
644  'schema' => $wgSharedSchema,
645  'prefix' => $wgSharedPrefix
646  ]
647  )
648  );
649 }
650 
651 // Raise the memory limit if it's too low
652 // Note, this makes use of wfDebug, and thus should not be before
653 // MWDebug::init() is called.
655 
661 if ( $wgLocaltimezone === null ) {
662  Wikimedia\suppressWarnings();
663  $wgLocaltimezone = date_default_timezone_get();
664  Wikimedia\restoreWarnings();
665 }
666 
667 date_default_timezone_set( $wgLocaltimezone );
668 if ( $wgLocalTZoffset === null ) {
669  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
670 }
671 // The part after the System| is ignored, but rest of MW fills it
672 // out as the local offset.
673 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
674 
675 if ( !$wgDBerrorLogTZ ) {
677 }
678 
679 // Initialize the request object in $wgRequest
680 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
681 
682 // Make sure that object caching does not undermine the ChronologyProtector improvements
683 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
684  // The user is pinned to the primary DC, meaning that they made recent changes which should
685  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
686  // they use a blind TTL and could be stale if an object changes twice in a short time span.
687  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
688 }
689 
690 // Useful debug output
691 ( static function () {
693  $logger = LoggerFactory::getInstance( 'wfDebug' );
694  if ( $wgCommandLineMode ) {
695  $self = $_SERVER['PHP_SELF'] ?? '';
696  $logger->debug( "\n\nStart command line script $self" );
697  } else {
698  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
699  $debug .= "IP: " . $wgRequest->getIP() . "\n";
700  $debug .= "HTTP HEADERS:\n";
701  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
702  $debug .= "$name: $value\n";
703  }
704  $debug .= "(end headers)";
705  $logger->debug( $debug );
706  }
707 } )();
708 
709 // Most of the config is out, some might want to run hooks here.
710 Hooks::runner()->onSetupAfterCache();
711 
712 // Now that variant lists may be available...
713 $wgRequest->interpolateTitle();
714 
719 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
720  // If session.auto_start is there, we can't touch session name
721  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
722  HeaderCallback::warnIfHeadersSent();
723  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
724  }
725 
726  // Create the SessionManager singleton and set up our session handler,
727  // unless we're specifically asked not to.
728  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
730  MediaWiki\Session\SessionManager::singleton()
731  );
732  }
733 
734  $contLang = MediaWikiServices::getInstance()->getContentLanguage();
735 
736  // Initialize the session
737  try {
739  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
740  // The exception is because the request had multiple possible
741  // sessions tied for top priority. Report this to the user.
742  $list = [];
743  foreach ( $ex->getSessionInfos() as $info ) {
744  $list[] = $info->getProvider()->describe( $contLang );
745  }
746  $list = $contLang->listToText( $list );
747  throw new HttpError( 400,
748  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $contLang )
749  );
750  }
751 
752  unset( $contLang );
753 
754  if ( $session->isPersistent() ) {
755  $wgInitialSessionId = $session->getSessionId();
756  }
757 
758  $session->renew();
759  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
760  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
761  session_id() !== $session->getId()
762  ) {
763  // Start the PHP-session for backwards compatibility
764  if ( session_id() !== '' ) {
765  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
766  'old_id' => session_id(),
767  'new_id' => $session->getId(),
768  ] );
769  session_write_close();
770  }
771  session_id( $session->getId() );
772  session_start();
773  }
774 
775  unset( $session );
776 } else {
777  // Even if we didn't set up a global Session, still install our session
778  // handler unless specifically requested not to.
779  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
781  MediaWiki\Session\SessionManager::singleton()
782  );
783  }
784 }
785 
791 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
792 
797 
801 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
802 
807 $wgParser = new DeprecatedGlobal( 'wgParser', static function () {
808  return MediaWikiServices::getInstance()->getParser();
809 }, '1.32' );
810 
814 $wgTitle = null;
815 
816 // Extension setup functions
817 // Entries should be added to this variable during the inclusion
818 // of the extension file. This allows the extension to perform
819 // any necessary initialisation in the fully initialised environment
820 foreach ( $wgExtensionFunctions as $func ) {
821  call_user_func( $func );
822 }
823 unset( $func ); // no global pollution; destroy reference
824 
825 // If the session user has a 0 id but a valid name, that means we need to
826 // autocreate it.
827 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
828  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
829  if ( $sessionUser->getId() === 0 &&
830  MediaWikiServices::getInstance()->getUserNameUtils()->isValid( $sessionUser->getName() )
831  ) {
832  $res = MediaWikiServices::getInstance()->getAuthManager()->autoCreateUser(
833  $sessionUser,
834  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
835  true
836  );
837  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
838  'event' => 'autocreate',
839  'status' => strval( $res ),
840  ] );
841  unset( $res );
842  }
843  unset( $sessionUser );
844 }
845 
846 if ( !$wgCommandLineMode ) {
848 }
849 
851 
852 // T264370
853 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
854  MediaWiki\Session\SessionManager::singleton()->logPotentialSessionLeakage();
855 }
$wgCanonicalNamespaceNames
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:455
$wgSharedUploadDirectory
string $wgSharedUploadDirectory
Shortcut for the 'directory' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:740
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
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:448
$wgMaximalPasswordLength
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
Definition: DefaultSettings.php:5468
MW_NO_SESSION
const MW_NO_SESSION
Definition: load.php:32
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:2067
$wgFileBlacklist
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
Definition: DefaultSettings.php:1090
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:72
$serverParts
if( $wgServer===false) if( $wgCanonicalServer===false) $serverParts
Definition: Setup.php:594
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:9086
$wgParser
$wgParser
Definition: Setup.php:807
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:437
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:3133
$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:308
$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:8281
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:2042
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:406
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:444
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2207
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:180
$wgSharedSchema
$wgSharedSchema
Definition: DefaultSettings.php:2213
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:8940
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:447
$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:2087
$wgSharedDB
$wgSharedDB
Shared database for multiple wikis.
Definition: DefaultSettings.php:2196
$wgLocalFileRepo
$wgLocalFileRepo
File repository structures.
Definition: DefaultSettings.php:675
$wgWANObjectCaches
$wgWANObjectCaches
Advanced WAN object cache configuration.
Definition: DefaultSettings.php:2856
$wgSharedUploadDBname
bool string $wgSharedUploadDBname
Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:785
DBO_DEBUG
const DBO_DEBUG
Definition: defines.php:9
wfMemoryLimit
wfMemoryLimit( $newLimit)
Raise PHP's memory limit (if needed).
Definition: GlobalFunctions.php:2458
$wgDBmwschema
$wgDBmwschema
Current wiki database schema name.
Definition: DefaultSettings.php:2052
$wgVirtualRestConfig
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:621
$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:289
$wgEnableUserEmail
$wgEnableUserEmail
Definition: Setup.php:436
$wgRequestTimeLimit
int null $wgRequestTimeLimit
Set a limit on server request wall clock time.
Definition: DefaultSettings.php:2551
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
MWExceptionHandler\installHandler
static installHandler()
Install handlers with PHP.
Definition: MWExceptionHandler.php:66
WebRequest\detectProtocol
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:300
$wgScopeTest
if(!defined( 'MEDIAWIKI')) $wgScopeTest
Environment checks.
Definition: Setup.php:69
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2699
$res
$res
Definition: testCompression.php:57
$wgSharedThumbnailScriptPath
string $wgSharedThumbnailScriptPath
Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:1065
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:312
$wgLang
$wgLang
Definition: Setup.php:796
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:4508
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:32
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:2082
$wgDBprefix
$wgDBprefix
Current wiki database table name prefix.
Definition: DefaultSettings.php:2062
$wgFetchCommonsDescriptions
bool $wgFetchCommonsDescriptions
Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:775
$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:766
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:404
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:701
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:136
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:758
$wgNoReplyAddress
$wgNoReplyAddress
Reply-To address for e-mail notifications.
Definition: DefaultSettings.php:1830
$wgEnotifMaxRecips
$wgEnotifMaxRecips
Definition: Setup.php:439
$wgEmergencyContact
$wgEmergencyContact
Site admin email address.
Definition: DefaultSettings.php:1813
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:996
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:3877
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2718
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:29
$wgFullyInitialised
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition: Setup.php:850
$wgFileExtensions
if( $wgScript===false) if( $wgLoadScript===false) if( $wgRestPath===false) if( $wgArticlePath===false) if( $wgResourceBasePath===null) if( $wgStylePath===false) if( $wgLocalStylePath===false) if( $wgExtensionAssetsPath===false) if( $wgLogos !==false &&isset( $wgLogos['1x'])) if( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if( $wgGitInfoCacheDirectory===false && $wgCacheDirectory !==false) if( $wgSharedPrefix===false) if( $wgSharedSchema===false) if( $wgMetaNamespace===false) $wgFileExtensions
Expand dynamic defaults and shortcuts.
Definition: Setup.php:248
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:467
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:28
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:443
$wgLoadScript
$wgLoadScript
The URL path to load.php.
Definition: DefaultSettings.php:212
MediaWiki
A helper class for throttling authentication attempts.
$wgSharedPrefix
$wgSharedPrefix
Definition: DefaultSettings.php:2201
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:8855
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:442
$wgEnableEmail
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
Definition: DefaultSettings.php:1837
$wgLogos
array false $wgLogos
Specification for different versions of the wiki logo.
Definition: DefaultSettings.php:364
$wgCookiePrefix
if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:427
$wgSessionName
$wgSessionName
Override to customise the session name.
Definition: DefaultSettings.php:7165
MWDebug\setup
static setup()
Definition: MWDebug.php:78
$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:1073
$wgEnotifRevealEditorAddress
$wgEnotifRevealEditorAddress
Definition: Setup.php:441
$wgMemoryLimit
$wgMemoryLimit
The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit i...
Definition: DefaultSettings.php:2620
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:294
$wgDatabaseReplicaLagWarning
$wgDatabaseReplicaLagWarning
If lag is higher than $wgDatabaseReplicaLagWarning, show a warning in some special pages (like watchl...
Definition: DefaultSettings.php:2341
$wgTitle
$wgTitle
Definition: Setup.php:814
$wgUseSharedUploads
bool $wgUseSharedUploads
Shortcut for adding an entry to $wgForeignFileRepos.
Definition: DefaultSettings.php:731
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:2512
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:440
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:3681
$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:803
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:172
$wgRCMaxAge
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
Definition: DefaultSettings.php:7865
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:80
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:8286
$wgExtensionFunctions
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
Definition: DefaultSettings.php:8413
$wgEmailAuthentication
$wgEmailAuthentication
Definition: Setup.php:435
$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:1929
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:483
$wgLogActionsHandlers
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
Definition: DefaultSettings.php:8968
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:1871
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:4370
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:446
$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:3064
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:3070
Message\newFromKey
static newFromKey( $key,... $params)
Factory function that is just wrapper for the real constructor.
Definition: Message.php:388
wfTempDir
wfTempDir()
Tries to get the system directory for temporary files.
Definition: GlobalFunctions.php:1755
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:7816
$wgThumbnailScriptPath
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
Definition: DefaultSettings.php:1056
$wgGroupPermissions
$wgGroupPermissions
Permission keys given to users in each group.
Definition: DefaultSettings.php:5908
FatalError
Abort the web request with a custom HTML string that will represent the entire response.
Definition: FatalError.php:37
$wgInitialSessionId
MediaWiki Session SessionId null $wgInitialSessionId
The persistent session ID (if any) loaded at startup.
Definition: Setup.php:718
$wgLocaltimezone
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Definition: DefaultSettings.php:3670
$wgEnotifImpersonal
$wgEnotifImpersonal
Definition: Setup.php:438
$wgSharedUploadDBprefix
string $wgSharedUploadDBprefix
Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:794
$wgCookieSecure
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
Definition: DefaultSettings.php:7111
$wgShellLocale
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
Definition: DefaultSettings.php:9565
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:8917
$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:2077
$wgDBerrorLogTZ
$wgDBerrorLogTZ
Timezone to use in the error log.
Definition: DefaultSettings.php:2317
$wgPasswordPolicy
$wgPasswordPolicy
Password policy for the wiki.
Definition: DefaultSettings.php:5221
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:7235
$wgRequest
if(! $wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:680
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:5455
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:599
$wgOut
$wgOut
Definition: Setup.php:801
$wgPasswordSender
$wgPasswordSender
Sender email address for e-mail notifications.
Definition: DefaultSettings.php:1823
$wgPHPSessionHandling
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
Definition: DefaultSettings.php:2955
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3474
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:176
DBO_DEFAULT
const DBO_DEFAULT
Definition: defines.php:13
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:690
$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:5719
$wgGenerateThumbnailOnParse
bool $wgGenerateThumbnailOnParse
Render thumbnails while parsing wikitext.
Definition: DefaultSettings.php:1455
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:4552
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:9080
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2829
$wgDatabaseReplicaLagCritical
$wgDatabaseReplicaLagCritical
Definition: DefaultSettings.php:2348
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:8273
$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:749