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