MediaWiki  master
Setup.php
Go to the documentation of this file.
1 <?php
52 use Psr\Log\LoggerInterface;
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 
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 
161 ExtensionRegistry::getInstance()->loadFromQueue();
162 // Don't let any other extensions load
164 
165 // Set the configured locale on all requests for consistency
166 // This must be after LocalSettings.php (and is informed by the installer).
167 putenv( "LC_ALL=$wgShellLocale" );
168 setlocale( LC_ALL, $wgShellLocale );
169 
174 if ( $wgScript === false ) {
175  $wgScript = "$wgScriptPath/index.php";
176 }
177 if ( $wgLoadScript === false ) {
178  $wgLoadScript = "$wgScriptPath/load.php";
179 }
180 if ( $wgRestPath === false ) {
181  $wgRestPath = "$wgScriptPath/rest.php";
182 }
183 if ( $wgArticlePath === false ) {
184  if ( $wgUsePathInfo ) {
185  $wgArticlePath = "$wgScript/$1";
186  } else {
187  $wgArticlePath = "$wgScript?title=$1";
188  }
189 }
190 if ( $wgResourceBasePath === null ) {
192 }
193 if ( $wgStylePath === false ) {
194  $wgStylePath = "$wgResourceBasePath/skins";
195 }
196 if ( $wgLocalStylePath === false ) {
197  // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
198  $wgLocalStylePath = "$wgScriptPath/skins";
199 }
200 if ( $wgExtensionAssetsPath === false ) {
201  $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
202 }
203 
204 // For backwards compatibility, the value of wgLogos is copied to wgLogo.
205 // This is because some extensions/skins may be using $config->get('Logo')
206 // to access the value.
207 if ( $wgLogos !== false && isset( $wgLogos['1x'] ) ) {
208  $wgLogo = $wgLogos['1x'];
209 }
210 if ( $wgLogo === false ) {
211  $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
212 }
213 
214 if ( $wgUploadPath === false ) {
215  $wgUploadPath = "$wgScriptPath/images";
216 }
217 if ( $wgUploadDirectory === false ) {
218  $wgUploadDirectory = "$IP/images";
219 }
220 if ( $wgReadOnlyFile === false ) {
221  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
222 }
223 if ( $wgFileCacheDirectory === false ) {
224  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
225 }
226 if ( $wgDeletedDirectory === false ) {
227  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
228 }
229 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
230  $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
231 }
232 if ( $wgSharedPrefix === false ) {
234 }
235 if ( $wgSharedSchema === false ) {
237 }
238 if ( $wgMetaNamespace === false ) {
239  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
240 }
241 
242 // Blacklisted file extensions shouldn't appear on the "allowed" list
243 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
244 
245 // Fix path to icon images after they were moved in 1.24
246 if ( $wgRightsIcon ) {
247  $wgRightsIcon = str_replace(
248  "{$wgStylePath}/common/images/",
249  "{$wgResourceBasePath}/resources/assets/licenses/",
251  );
252 }
253 
254 if ( isset( $wgFooterIcons['copyright']['copyright'] )
255  && $wgFooterIcons['copyright']['copyright'] === []
256 ) {
257  if ( $wgRightsIcon || $wgRightsText ) {
258  $wgFooterIcons['copyright']['copyright'] = [
259  'url' => $wgRightsUrl,
260  'src' => $wgRightsIcon,
261  'alt' => $wgRightsText,
262  ];
263  }
264 }
265 
266 if ( isset( $wgFooterIcons['poweredby'] )
267  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
268  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
269 ) {
270  $wgFooterIcons['poweredby']['mediawiki']['src'] =
271  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
272  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
273  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
274  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
275 }
276 
285 
290  'name' => 'fsLockManager',
291  'class' => FSLockManager::class,
292  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
293 ];
294 $wgLockManagers[] = [
295  'name' => 'nullLockManager',
296  'class' => NullLockManager::class,
297 ];
298 
304  'imagesPerRow' => 0,
305  'imageWidth' => 120,
306  'imageHeight' => 120,
307  'captionLength' => true,
308  'showBytes' => true,
309  'showDimensions' => true,
310  'mode' => 'traditional',
311 ];
312 
316 if ( !$wgLocalFileRepo ) {
317  $wgLocalFileRepo = [
318  'class' => LocalRepo::class,
319  'name' => 'local',
320  'directory' => $wgUploadDirectory,
321  'scriptDirUrl' => $wgScriptPath,
323  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
324  'thumbScriptUrl' => $wgThumbnailScriptPath,
325  'transformVia404' => !$wgGenerateThumbnailOnParse,
326  'deletedDir' => $wgDeletedDirectory,
327  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0
328  ];
329 }
330 
331 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
332  // Create a default FileBackend name.
333  // FileBackendGroup will register a default, if absent from $wgFileBackends.
334  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
335 }
336 
340 if ( $wgUseSharedUploads ) {
341  if ( $wgSharedUploadDBname ) {
342  $wgForeignFileRepos[] = [
343  'class' => ForeignDBRepo::class,
344  'name' => 'shared',
345  'directory' => $wgSharedUploadDirectory,
346  'url' => $wgSharedUploadPath,
347  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
348  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
349  'transformVia404' => !$wgGenerateThumbnailOnParse,
350  'dbType' => $wgDBtype,
351  'dbServer' => $wgDBserver,
352  'dbUser' => $wgDBuser,
353  'dbPassword' => $wgDBpassword,
354  'dbName' => $wgSharedUploadDBname,
355  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
356  'tablePrefix' => $wgSharedUploadDBprefix,
357  'hasSharedCache' => $wgCacheSharedUploads,
358  'descBaseUrl' => $wgRepositoryBaseUrl,
359  'fetchDescription' => $wgFetchCommonsDescriptions,
360  ];
361  } else {
362  $wgForeignFileRepos[] = [
363  'class' => FileRepo::class,
364  'name' => 'shared',
365  'directory' => $wgSharedUploadDirectory,
366  'url' => $wgSharedUploadPath,
367  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
368  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
369  'transformVia404' => !$wgGenerateThumbnailOnParse,
370  'descBaseUrl' => $wgRepositoryBaseUrl,
371  'fetchDescription' => $wgFetchCommonsDescriptions,
372  ];
373  }
374 }
375 if ( $wgUseInstantCommons ) {
376  $wgForeignFileRepos[] = [
377  'class' => ForeignAPIRepo::class,
378  'name' => 'wikimediacommons',
379  'apibase' => 'https://commons.wikimedia.org/w/api.php',
380  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
381  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
382  'hashLevels' => 2,
383  'transformVia404' => true,
384  'fetchDescription' => true,
385  'descriptionCacheExpiry' => 43200,
386  'apiThumbCacheExpiry' => 0,
387  ];
388 }
389 foreach ( $wgForeignFileRepos as &$repo ) {
390  if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
391  $repo['directory'] = $wgUploadDirectory; // b/c
392  }
393  if ( !isset( $repo['backend'] ) ) {
394  $repo['backend'] = $repo['name'] . '-backend';
395  }
396 }
397 unset( $repo ); // no global pollution; destroy reference
398 
399 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
400 // Ensure that default user options are not invalid, since that breaks Special:Preferences
401 $wgDefaultUserOptions['rcdays'] = min(
402  $wgDefaultUserOptions['rcdays'],
403  ceil( $rcMaxAgeDays )
404 );
405 $wgDefaultUserOptions['watchlistdays'] = min(
406  $wgDefaultUserOptions['watchlistdays'],
407  ceil( $rcMaxAgeDays )
408 );
409 unset( $rcMaxAgeDays );
410 
411 if ( !$wgCookiePrefix ) {
412  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
414  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
416  } elseif ( $wgDBprefix ) {
418  } else {
420  }
421 }
422 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
423 
424 if ( $wgEnableEmail ) {
426 } else {
427  // Disable all other email settings automatically if $wgEnableEmail
428  // is set to false. - T65678
429  $wgAllowHTMLEmail = false;
430  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
440  unset( $wgGroupPermissions['user']['sendemail'] );
441  $wgUseEnotif = false;
444 }
445 
451 
453 if ( is_array( $wgExtraNamespaces ) ) {
455 }
456 
457 // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php
458 if ( count( $wgDummyLanguageCodes ) !== 0 ) {
459  wfDeprecated( '$wgDummyLanguageCodes', '1.29' );
460 }
461 // Merge in the legacy language codes, incorporating overrides from the config
463  // Internal language codes of the private-use area which get mapped to
464  // themselves.
465  'qqq' => 'qqq', // Used for message documentation
466  'qqx' => 'qqx', // Used for viewing message keys
468 // Merge in (inverted) BCP 47 mappings
469 foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) {
470  $bcp47 = strtolower( $bcp47 ); // force case-insensitivity
471  if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) {
472  $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code;
473  }
474 }
475 
477  Wikimedia\suppressWarnings();
478  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
479  Wikimedia\restoreWarnings();
480 }
481 
482 if ( $wgNewUserLog ) {
483  // Add new user log type
484  $wgLogTypes[] = 'newusers';
485  $wgLogNames['newusers'] = 'newuserlogpage';
486  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
487  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
488  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
489  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
490  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
491  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
492 }
493 
494 if ( $wgPageCreationLog ) {
495  // Add page creation log type
496  $wgLogTypes[] = 'create';
497  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
498 }
499 
500 if ( $wgPageLanguageUseDB ) {
501  $wgLogTypes[] = 'pagelang';
502  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
503 }
504 
505 if ( $wgCookieSecure === 'detect' ) {
507 }
508 
509 // Backwards compatibility with old password limits
510 if ( $wgMinimalPasswordLength !== false ) {
511  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
512 }
513 
514 if ( $wgMaximalPasswordLength !== false ) {
515  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
516 }
517 
518 if ( $wgPHPSessionHandling !== 'enable' &&
519  $wgPHPSessionHandling !== 'warn' &&
520  $wgPHPSessionHandling !== 'disable'
521 ) {
522  $wgPHPSessionHandling = 'warn';
523 }
524 if ( defined( 'MW_NO_SESSION' ) ) {
525  // If the entry point wants no session, force 'disable' here unless they
526  // specifically set it to the (undocumented) 'warn'.
527  // @phan-suppress-next-line PhanUndeclaredConstant
528  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
529 }
530 
532 
533 // Reset the global service locator, so any services that have already been created will be
534 // re-created while taking into account any custom settings and extensions.
535 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
536 
537 // Define a constant that indicates that the bootstrapping of the service locator
538 // is complete.
539 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
540 
542 
543 // T30798: $wgServer must be explicitly set
544 // @phan-suppress-next-line PhanSuspiciousValueComparisonInGlobalScope
545 if ( $wgServer === false ) {
546  throw new FatalError(
547  '$wgServer must be set in LocalSettings.php. ' .
548  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
549  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
550  );
551 }
552 
553 if ( $wgCanonicalServer === false ) {
555 }
556 
557 // Set server name
559 if ( $wgServerName !== false ) {
560  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
561  . 'not customized. Overwriting $wgServerName.' );
562 }
564 unset( $serverParts );
565 
566 // Set defaults for configuration variables
567 // that are derived from the server name by default
568 // Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
569 if ( !$wgEmergencyContact ) {
570  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
571 }
572 if ( !$wgPasswordSender ) {
573  $wgPasswordSender = 'apache@' . $wgServerName;
574 }
575 if ( !$wgNoReplyAddress ) {
577 }
578 
579 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
580  $wgSecureLogin = false;
581  wfWarn( 'Secure login was enabled on a server that only supports '
582  . 'HTTP or HTTPS. Disabling secure login.' );
583 }
584 
586 
587 // Now that GlobalFunctions is loaded, set defaults that depend on it.
588 if ( $wgTmpDirectory === false ) {
590 }
591 
592 if ( $wgMainWANCache === false ) {
593  // Setup a WAN cache from $wgMainCacheType
594  $wgMainWANCache = 'mediawiki-main-default';
596  'class' => WANObjectCache::class,
597  'cacheId' => $wgMainCacheType,
598  ];
599 }
600 
601 if ( $wgSharedDB && $wgSharedTables ) {
602  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
603  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
604  array_fill_keys(
606  [
607  'dbname' => $wgSharedDB,
608  'schema' => $wgSharedSchema,
609  'prefix' => $wgSharedPrefix
610  ]
611  )
612  );
613 }
614 
615 // Raise the memory limit if it's too low
616 // Note, this makes use of wfDebug, and thus should not be before
617 // MWDebug::init() is called.
619 
625 if ( $wgLocaltimezone === null ) {
626  Wikimedia\suppressWarnings();
627  $wgLocaltimezone = date_default_timezone_get();
628  Wikimedia\restoreWarnings();
629 }
630 
631 date_default_timezone_set( $wgLocaltimezone );
632 if ( $wgLocalTZoffset === null ) {
633  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
634 }
635 // The part after the System| is ignored, but rest of MW fills it
636 // out as the local offset.
637 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
638 
639 if ( !$wgDBerrorLogTZ ) {
641 }
642 
643 // Initialize the request object in $wgRequest
644 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
645 // Set user IP/agent information for agent session consistency purposes
646 $cpPosInfo = LBFactory::getCPInfoFromCookieValue(
647  // The cookie has no prefix and is set by MediaWiki::preOutputCommit()
648  $wgRequest->getCookie( 'cpPosIndex', '' ),
649  // Mitigate broken client-side cookie expiration handling (T190082)
650  time() - ChronologyProtector::POSITION_COOKIE_TTL
651 );
652 MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
653  'IPAddress' => $wgRequest->getIP(),
654  'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
655  'ChronologyProtection' => $wgRequest->getHeader( 'MediaWiki-Chronology-Protection' ),
656  'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ),
657  'ChronologyClientId' => $cpPosInfo['clientId']
658  ?? $wgRequest->getHeader( 'MediaWiki-Chronology-Client-Id' )
659 ] );
660 unset( $cpPosInfo );
661 // Make sure that object caching does not undermine the ChronologyProtector improvements
662 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
663  // The user is pinned to the primary DC, meaning that they made recent changes which should
664  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
665  // they use a blind TTL and could be stale if an object changes twice in a short time span.
666  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
667 }
668 
669 // Useful debug output
670 ( function () {
672  $logger = LoggerFactory::getInstance( 'wfDebug' );
673  if ( $wgCommandLineMode ) {
674  $self = $_SERVER['PHP_SELF'] ?? '';
675  $logger->debug( "\n\nStart command line script $self" );
676  } else {
677  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
678  $debug .= "IP: " . $wgRequest->getIP() . "\n";
679  $debug .= "HTTP HEADERS:\n";
680  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
681  $debug .= "$name: $value\n";
682  }
683  $debug .= "(end headers)";
684  $logger->debug( $debug );
685  }
686 } )();
687 
688 // Most of the config is out, some might want to run hooks here.
689 Hooks::runner()->onSetupAfterCache();
690 
695 $wgContLang = MediaWikiServices::getInstance()->getContentLanguage();
696 
697 // Now that variant lists may be available...
698 $wgRequest->interpolateTitle();
699 
704 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
705  // If session.auto_start is there, we can't touch session name
706  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
707  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
708  }
709 
710  // Create the SessionManager singleton and set up our session handler,
711  // unless we're specifically asked not to.
712  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
714  MediaWiki\Session\SessionManager::singleton()
715  );
716  }
717 
718  // Initialize the session
719  try {
721  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
722  // The exception is because the request had multiple possible
723  // sessions tied for top priority. Report this to the user.
724  $list = [];
725  foreach ( $ex->getSessionInfos() as $info ) {
726  $list[] = $info->getProvider()->describe( $wgContLang );
727  }
728  $list = $wgContLang->listToText( $list );
729  throw new HttpError( 400,
730  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
731  );
732  }
733 
734  if ( $session->isPersistent() ) {
735  $wgInitialSessionId = $session->getSessionId();
736  }
737 
738  $session->renew();
739  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
740  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
741  session_id() !== $session->getId()
742  ) {
743  // Start the PHP-session for backwards compatibility
744  if ( session_id() !== '' ) {
745  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
746  'old_id' => session_id(),
747  'new_id' => $session->getId(),
748  ] );
749  session_write_close();
750  }
751  session_id( $session->getId() );
752  session_start();
753  }
754 
755  unset( $session );
756 } else {
757  // Even if we didn't set up a global Session, still install our session
758  // handler unless specifically requested not to.
759  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
761  MediaWiki\Session\SessionManager::singleton()
762  );
763  }
764 }
765 
771 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
772 
777 
781 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
782 
787 $wgParser = new DeprecatedGlobal( 'wgParser', function () {
788  return MediaWikiServices::getInstance()->getParser();
789 }, '1.32' );
790 
794 $wgTitle = null;
795 
796 // Extension setup functions
797 // Entries should be added to this variable during the inclusion
798 // of the extension file. This allows the extension to perform
799 // any necessary initialisation in the fully initialised environment
800 foreach ( $wgExtensionFunctions as $func ) {
801  call_user_func( $func );
802 }
803 
804 // If the session user has a 0 id but a valid name, that means we need to
805 // autocreate it.
806 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
807  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
808  if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
809  $res = MediaWikiServices::getInstance()->getAuthManager()->autoCreateUser(
810  $sessionUser,
811  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
812  true
813  );
814  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
815  'event' => 'autocreate',
816  'status' => $res,
817  ] );
818  unset( $res );
819  }
820  unset( $sessionUser );
821 }
822 
823 if ( !$wgCommandLineMode ) {
825 }
826 
$wgCanonicalNamespaceNames
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:450
$wgSharedUploadDirectory
string $wgSharedUploadDirectory
Shortcut for the 'directory' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:675
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\HeaderCallback\register
static register()
Register a callback to be called when headers are sent.
Definition: HeaderCallback.php:19
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:443
$wgMaximalPasswordLength
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
Definition: DefaultSettings.php:5097
MW_NO_SESSION
const MW_NO_SESSION
Definition: load.php:32
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:2014
$wgFileBlacklist
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
Definition: DefaultSettings.php:1025
$serverParts
if( $wgServer===false) if( $wgCanonicalServer===false) $serverParts
Definition: Setup.php:558
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:8359
$wgParser
$wgParser
Definition: Setup.php:787
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:432
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:2837
$wgRestPath
$wgRestPath
The URL path to the REST API Defaults to "{$wgScriptPath}/rest.php".
Definition: DefaultSettings.php:222
$wgGalleryOptions
$wgGalleryOptions
Default parameters for the "<gallery>" tag.
Definition: Setup.php:303
$wgTmpDirectory
$wgTmpDirectory
The local filesystem path to a temporary directory.
Definition: DefaultSettings.php:414
$wgRightsText
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
Definition: DefaultSettings.php:7574
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:1989
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:401
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:439
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2153
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:160
$wgSharedSchema
$wgSharedSchema
Definition: DefaultSettings.php:2159
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:8213
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:442
$wgScript
$wgScript
The URL path to index.php.
Definition: DefaultSettings.php:207
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:2034
$wgSharedDB
$wgSharedDB
Shared database for multiple wikis.
Definition: DefaultSettings.php:2143
$wgLocalFileRepo
$wgLocalFileRepo
File repository structures.
Definition: DefaultSettings.php:610
$wgWANObjectCaches
$wgWANObjectCaches
Advanced WAN object cache configuration.
Definition: DefaultSettings.php:2584
$wgSharedUploadDBname
bool string $wgSharedUploadDBname
Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:720
DBO_DEBUG
const DBO_DEBUG
Definition: defines.php:9
wfMemoryLimit
wfMemoryLimit( $newLimit)
Raise PHP's memory limit (if needed).
Definition: GlobalFunctions.php:2625
$wgDBmwschema
$wgDBmwschema
Current wiki database schema name.
Definition: DefaultSettings.php:1999
$wgVirtualRestConfig
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:585
$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:284
$wgEnableUserEmail
$wgEnableUserEmail
Definition: Setup.php:431
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:244
MWExceptionHandler\installHandler
static installHandler()
Install handlers with PHP.
Definition: MWExceptionHandler.php:66
WebRequest\detectProtocol
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:298
$wgScopeTest
if(!defined( 'MEDIAWIKI')) $wgScopeTest
Environment checks.
Definition: Setup.php:69
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2429
User\isValidUserName
static isValidUserName( $name)
Is the input a valid username?
Definition: User.php:993
$res
$res
Definition: testCompression.php:57
$wgSharedThumbnailScriptPath
string $wgSharedThumbnailScriptPath
Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:1000
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:307
$wgTitle
$wgTitle
Definition: Setup.php:794
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:989
$wgMetaNamespace
$wgMetaNamespace
Name of the project namespace.
Definition: DefaultSettings.php:4240
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:32
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:2029
$wgDBprefix
$wgDBprefix
Current wiki database table name prefix.
Definition: DefaultSettings.php:2009
$wgFetchCommonsDescriptions
bool $wgFetchCommonsDescriptions
Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:710
$wgStylePath
$wgStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:229
$debug
$debug
Definition: mcc.php:31
$wgRepositoryBaseUrl
$wgRepositoryBaseUrl
Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:701
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:399
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:636
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:136
wfParseUrl
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
Definition: GlobalFunctions.php:792
$wgHashedSharedUploadDirectory
bool $wgHashedSharedUploadDirectory
Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:693
$wgNoReplyAddress
$wgNoReplyAddress
Reply-To address for e-mail notifications.
Definition: DefaultSettings.php:1776
$wgEnotifMaxRecips
$wgEnotifMaxRecips
Definition: Setup.php:434
$wgEmergencyContact
$wgEmergencyContact
Site admin email address.
Definition: DefaultSettings.php:1759
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1027
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:3611
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2448
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:29
$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:243
$wgLang
$wgLang
Definition: Setup.php:776
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:462
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:26
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:438
$wgLoadScript
$wgLoadScript
The URL path to load.php.
Definition: DefaultSettings.php:215
MediaWiki
A helper class for throttling authentication attempts.
$wgSharedPrefix
$wgSharedPrefix
Definition: DefaultSettings.php:2148
$wgLogTypes
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
Definition: DefaultSettings.php:8128
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:437
$wgEnableEmail
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
Definition: DefaultSettings.php:1783
$wgLogos
array false $wgLogos
The URL path to various wiki logos.
Definition: DefaultSettings.php:326
GlobalVarConfig
Accesses configuration settings from $GLOBALS.
Definition: GlobalVarConfig.php:29
$wgCookiePrefix
if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:422
$wgSessionName
$wgSessionName
Override to customise the session name.
Definition: DefaultSettings.php:6521
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:120
$wgHashedUploadDirectory
bool $wgHashedUploadDirectory
Shortcut for setting hashLevels=2 in $wgLocalFileRepo.
Definition: DefaultSettings.php:1008
$wgEnotifRevealEditorAddress
$wgEnotifRevealEditorAddress
Definition: Setup.php:436
$wgMemoryLimit
$wgMemoryLimit
The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit i...
Definition: DefaultSettings.php:2404
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:289
$wgUseSharedUploads
bool $wgUseSharedUploads
Shortcut for adding an entry to $wgForeignFileRepos.
Definition: DefaultSettings.php:666
$wgFullyInitialised
foreach( $wgExtensionFunctions as $func) if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition: Setup.php:827
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:9171
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:435
MediaWiki\Session\SessionManager\getGlobalSession
static getGlobalSession()
Get the "global" session.
Definition: SessionManager.php:114
$wgLocalTZoffset
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
Definition: DefaultSettings.php:3352
$wgForceHTTPS
bool $wgForceHTTPS
If this is true, when an insecure HTTP request is received, always redirect to HTTPS.
Definition: DefaultSettings.php:168
$wgDeletedDirectory
$wgDeletedDirectory
What directory to place deleted uploads in.
Definition: DefaultSettings.php:494
$wgCacheSharedUploads
bool $wgCacheSharedUploads
Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:738
StubUserLang
Stub object for the user language.
Definition: StubUserLang.php:24
$wgServer
$wgServer
URL of the server.
Definition: DefaultSettings.php:111
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:7199
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:80
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:7579
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:208
$wgExtensionFunctions
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
Definition: DefaultSettings.php:7702
$wgEmailAuthentication
$wgEmailAuthentication
Definition: Setup.php:430
$wgUploadBaseUrl
$wgUploadBaseUrl
If set, this URL is added to the start of $wgUploadPath to form a complete upload URL.
Definition: DefaultSettings.php:421
$wgUploadDirectory
$wgUploadDirectory
The filesystem path of the images directory.
Definition: DefaultSettings.php:292
$wgAllowHTMLEmail
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
Definition: DefaultSettings.php:1875
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:454
$wgLogActionsHandlers
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
Definition: DefaultSettings.php:8241
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:1994
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:4085
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:441
$wgArticlePath
$wgArticlePath
The URL path for primary article page views.
Definition: DefaultSettings.php:267
$self
$self
Definition: doMaintenance.php:63
$wgCacheEpoch
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
Definition: DefaultSettings.php:2768
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:2774
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:1878
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:7149
$wgThumbnailScriptPath
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
Definition: DefaultSettings.php:991
$wgGroupPermissions
$wgGroupPermissions
Permission keys given to users in each group.
Definition: DefaultSettings.php:5529
Wikimedia\Rdbms\ChronologyProtector
Helper class for mitigating DB replication lag in order to provide "session consistency".
Definition: ChronologyProtector.php:41
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:703
$wgLocaltimezone
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Definition: DefaultSettings.php:3341
$wgEnotifImpersonal
$wgEnotifImpersonal
Definition: Setup.php:433
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:729
$wgCookieSecure
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
Definition: DefaultSettings.php:6467
$wgShellLocale
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
Definition: DefaultSettings.php:8834
$cpPosInfo
$cpPosInfo
Definition: Setup.php:646
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:8190
$wgFileCacheDirectory
$wgFileCacheDirectory
Directory where the cached page will be saved.
Definition: DefaultSettings.php:298
$wgUploadPath
$wgUploadPath
The URL path for the images directory.
Definition: DefaultSettings.php:273
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:1074
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:77
$wgDBuser
$wgDBuser
Database username.
Definition: DefaultSettings.php:2024
$wgDBerrorLogTZ
$wgDBerrorLogTZ
Timezone to use in the error log.
Definition: DefaultSettings.php:2259
$wgPasswordPolicy
$wgPasswordPolicy
Password policy for the wiki.
Definition: DefaultSettings.php:4867
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:6594
$wgRequest
if(! $wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:644
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:273
$wgMinimalPasswordLength
$wgMinimalPasswordLength
Specifies the minimal length of a user password.
Definition: DefaultSettings.php:5084
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:563
$wgOut
$wgOut
Definition: Setup.php:781
$wgPasswordSender
$wgPasswordSender
Sender email address for e-mail notifications.
Definition: DefaultSettings.php:1769
$wgPHPSessionHandling
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
Definition: DefaultSettings.php:2668
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3164
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:179
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
$wgContLang
$wgContLang
Definition: Setup.php:695
$wgForeignFileRepos
$wgForeignFileRepos
Enable the use of files from one or more other wikis.
Definition: DefaultSettings.php:625
$wgLocalStylePath
$wgLocalStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:237
$wgSecureLogin
$wgSecureLogin
This is to let user authenticate using https when they come from http.
Definition: DefaultSettings.php:5347
$wgGenerateThumbnailOnParse
bool $wgGenerateThumbnailOnParse
Render thumbnails while parsing wikitext.
Definition: DefaultSettings.php:1401
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:4277
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:8353
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2557
$GLOBALS
$GLOBALS['IP']
Definition: ComposerHookHandler.php:6
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:490
$wgRightsUrl
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki.
Definition: DefaultSettings.php:7566
$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:198
$wgSharedUploadPath
string $wgSharedUploadPath
Shortcut for the 'url' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:684