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 unset( $code ); // no global pollution; destroy reference
476 unset( $bcp47 ); // no global pollution; destroy reference
477 
479  Wikimedia\suppressWarnings();
480  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
481  Wikimedia\restoreWarnings();
482 }
483 
484 if ( $wgNewUserLog ) {
485  // Add new user log type
486  $wgLogTypes[] = 'newusers';
487  $wgLogNames['newusers'] = 'newuserlogpage';
488  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
489  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
490  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
491  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
492  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
493  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
494 }
495 
496 if ( $wgPageCreationLog ) {
497  // Add page creation log type
498  $wgLogTypes[] = 'create';
499  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
500 }
501 
502 if ( $wgPageLanguageUseDB ) {
503  $wgLogTypes[] = 'pagelang';
504  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
505 }
506 
507 if ( $wgCookieSecure === 'detect' ) {
509 }
510 
511 // Backwards compatibility with old password limits
512 if ( $wgMinimalPasswordLength !== false ) {
513  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
514 }
515 
516 if ( $wgMaximalPasswordLength !== false ) {
517  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
518 }
519 
520 if ( $wgPHPSessionHandling !== 'enable' &&
521  $wgPHPSessionHandling !== 'warn' &&
522  $wgPHPSessionHandling !== 'disable'
523 ) {
524  $wgPHPSessionHandling = 'warn';
525 }
526 if ( defined( 'MW_NO_SESSION' ) ) {
527  // If the entry point wants no session, force 'disable' here unless they
528  // specifically set it to the (undocumented) 'warn'.
529  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
530 }
531 
533 
534 // Reset the global service locator, so any services that have already been created will be
535 // re-created while taking into account any custom settings and extensions.
536 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
537 
538 // Define a constant that indicates that the bootstrapping of the service locator
539 // is complete.
540 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
541 
543 
544 // T30798: $wgServer must be explicitly set
545 // @phan-suppress-next-line PhanSuspiciousValueComparisonInGlobalScope
546 if ( $wgServer === false ) {
547  throw new FatalError(
548  '$wgServer must be set in LocalSettings.php. ' .
549  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
550  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
551  );
552 }
553 
554 if ( $wgCanonicalServer === false ) {
556 }
557 
558 // Set server name
560 if ( $wgServerName !== false ) {
561  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
562  . 'not customized. Overwriting $wgServerName.' );
563 }
565 unset( $serverParts );
566 
567 // Set defaults for configuration variables
568 // that are derived from the server name by default
569 // Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
570 if ( !$wgEmergencyContact ) {
571  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
572 }
573 if ( !$wgPasswordSender ) {
574  $wgPasswordSender = 'apache@' . $wgServerName;
575 }
576 if ( !$wgNoReplyAddress ) {
578 }
579 
580 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
581  $wgSecureLogin = false;
582  wfWarn( 'Secure login was enabled on a server that only supports '
583  . 'HTTP or HTTPS. Disabling secure login.' );
584 }
585 
587 
588 // Now that GlobalFunctions is loaded, set defaults that depend on it.
589 if ( $wgTmpDirectory === false ) {
591 }
592 
593 if ( $wgMainWANCache === false ) {
594  // Setup a WAN cache from $wgMainCacheType
595  $wgMainWANCache = 'mediawiki-main-default';
597  'class' => WANObjectCache::class,
598  'cacheId' => $wgMainCacheType,
599  ];
600 }
601 
602 if ( $wgSharedDB && $wgSharedTables ) {
603  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
604  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
605  array_fill_keys(
607  [
608  'dbname' => $wgSharedDB,
609  'schema' => $wgSharedSchema,
610  'prefix' => $wgSharedPrefix
611  ]
612  )
613  );
614 }
615 
616 // Raise the memory limit if it's too low
617 // Note, this makes use of wfDebug, and thus should not be before
618 // MWDebug::init() is called.
620 
626 if ( $wgLocaltimezone === null ) {
627  Wikimedia\suppressWarnings();
628  $wgLocaltimezone = date_default_timezone_get();
629  Wikimedia\restoreWarnings();
630 }
631 
632 date_default_timezone_set( $wgLocaltimezone );
633 if ( $wgLocalTZoffset === null ) {
634  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
635 }
636 // The part after the System| is ignored, but rest of MW fills it
637 // out as the local offset.
638 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
639 
640 if ( !$wgDBerrorLogTZ ) {
642 }
643 
644 // Initialize the request object in $wgRequest
645 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
646 // Set user IP/agent information for agent session consistency purposes
647 $cpPosInfo = LBFactory::getCPInfoFromCookieValue(
648  // The cookie has no prefix and is set by MediaWiki::preOutputCommit()
649  $wgRequest->getCookie( 'cpPosIndex', '' ),
650  // Mitigate broken client-side cookie expiration handling (T190082)
651  time() - ChronologyProtector::POSITION_COOKIE_TTL
652 );
653 MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
654  'IPAddress' => $wgRequest->getIP(),
655  'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
656  'ChronologyProtection' => $wgRequest->getHeader( 'MediaWiki-Chronology-Protection' ),
657  'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ),
658  'ChronologyClientId' => $cpPosInfo['clientId']
659  ?? $wgRequest->getHeader( 'MediaWiki-Chronology-Client-Id' )
660 ] );
661 unset( $cpPosInfo );
662 // Make sure that object caching does not undermine the ChronologyProtector improvements
663 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
664  // The user is pinned to the primary DC, meaning that they made recent changes which should
665  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
666  // they use a blind TTL and could be stale if an object changes twice in a short time span.
667  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
668 }
669 
670 // Useful debug output
671 ( function () {
673  $logger = LoggerFactory::getInstance( 'wfDebug' );
674  if ( $wgCommandLineMode ) {
675  $self = $_SERVER['PHP_SELF'] ?? '';
676  $logger->debug( "\n\nStart command line script $self" );
677  } else {
678  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
679  $debug .= "IP: " . $wgRequest->getIP() . "\n";
680  $debug .= "HTTP HEADERS:\n";
681  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
682  $debug .= "$name: $value\n";
683  }
684  $debug .= "(end headers)";
685  $logger->debug( $debug );
686  }
687 } )();
688 
689 // Most of the config is out, some might want to run hooks here.
690 Hooks::runner()->onSetupAfterCache();
691 
696 $wgContLang = MediaWikiServices::getInstance()->getContentLanguage();
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  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
709  }
710 
711  // Create the SessionManager singleton and set up our session handler,
712  // unless we're specifically asked not to.
713  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
715  MediaWiki\Session\SessionManager::singleton()
716  );
717  }
718 
719  // Initialize the session
720  try {
722  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
723  // The exception is because the request had multiple possible
724  // sessions tied for top priority. Report this to the user.
725  $list = [];
726  foreach ( $ex->getSessionInfos() as $info ) {
727  $list[] = $info->getProvider()->describe( $wgContLang );
728  }
729  $list = $wgContLang->listToText( $list );
730  throw new HttpError( 400,
731  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )
732  );
733  }
734 
735  if ( $session->isPersistent() ) {
736  $wgInitialSessionId = $session->getSessionId();
737  }
738 
739  $session->renew();
740  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
741  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
742  session_id() !== $session->getId()
743  ) {
744  // Start the PHP-session for backwards compatibility
745  if ( session_id() !== '' ) {
746  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
747  'old_id' => session_id(),
748  'new_id' => $session->getId(),
749  ] );
750  session_write_close();
751  }
752  session_id( $session->getId() );
753  session_start();
754  }
755 
756  unset( $session );
757 } else {
758  // Even if we didn't set up a global Session, still install our session
759  // handler unless specifically requested not to.
760  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
762  MediaWiki\Session\SessionManager::singleton()
763  );
764  }
765 }
766 
772 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
773 
778 
782 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
783 
788 $wgParser = new DeprecatedGlobal( 'wgParser', function () {
789  return MediaWikiServices::getInstance()->getParser();
790 }, '1.32' );
791 
795 $wgTitle = null;
796 
797 // Extension setup functions
798 // Entries should be added to this variable during the inclusion
799 // of the extension file. This allows the extension to perform
800 // any necessary initialisation in the fully initialised environment
801 foreach ( $wgExtensionFunctions as $func ) {
802  call_user_func( $func );
803 }
804 unset( $func ); // no global pollution; destroy reference
805 
806 // If the session user has a 0 id but a valid name, that means we need to
807 // autocreate it.
808 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
809  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
810  if ( $sessionUser->getId() === 0 &&
811  MediaWikiServices::getInstance()->getUserNameUtils()->isValid( $sessionUser->getName() )
812  ) {
813  $res = MediaWikiServices::getInstance()->getAuthManager()->autoCreateUser(
814  $sessionUser,
815  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
816  true
817  );
818  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
819  'event' => 'autocreate',
820  'status' => $res,
821  ] );
822  unset( $res );
823  }
824  unset( $sessionUser );
825 }
826 
827 if ( !$wgCommandLineMode ) {
829 }
830 
832 
833 // T264370
834 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
835  MediaWiki\Session\SessionManager::singleton()->logPotentialSessionLeakage();
836 }
$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:679
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:5119
MW_NO_SESSION
const MW_NO_SESSION
Definition: load.php:32
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:2015
$wgFileBlacklist
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
Definition: DefaultSettings.php:1029
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:71
$serverParts
if( $wgServer===false) if( $wgCanonicalServer===false) $serverParts
Definition: Setup.php:559
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:8366
$wgParser
$wgParser
Definition: Setup.php:788
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:432
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:2851
$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:303
$wgTmpDirectory
$wgTmpDirectory
The local filesystem path to a temporary directory.
Definition: DefaultSettings.php:419
$wgRightsText
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
Definition: DefaultSettings.php:7584
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:1990
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:401
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:439
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2155
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:166
$wgSharedSchema
$wgSharedSchema
Definition: DefaultSettings.php:2161
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:8220
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:442
$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:2035
$wgSharedDB
$wgSharedDB
Shared database for multiple wikis.
Definition: DefaultSettings.php:2144
$wgLocalFileRepo
$wgLocalFileRepo
File repository structures.
Definition: DefaultSettings.php:614
$wgWANObjectCaches
$wgWANObjectCaches
Advanced WAN object cache configuration.
Definition: DefaultSettings.php:2583
$wgSharedUploadDBname
bool string $wgSharedUploadDBname
Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:724
DBO_DEBUG
const DBO_DEBUG
Definition: defines.php:9
wfMemoryLimit
wfMemoryLimit( $newLimit)
Raise PHP's memory limit (if needed).
Definition: GlobalFunctions.php:2616
$wgDBmwschema
$wgDBmwschema
Current wiki database schema name.
Definition: DefaultSettings.php:2000
$wgVirtualRestConfig
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:586
$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: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:299
$wgScopeTest
if(!defined( 'MEDIAWIKI')) $wgScopeTest
Environment checks.
Definition: Setup.php:69
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2428
$res
$res
Definition: testCompression.php:57
$wgSharedThumbnailScriptPath
string $wgSharedThumbnailScriptPath
Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:1004
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:312
$wgLang
$wgLang
Definition: Setup.php:777
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:995
$wgMetaNamespace
$wgMetaNamespace
Name of the project namespace.
Definition: DefaultSettings.php:4259
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:32
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:2030
$wgDBprefix
$wgDBprefix
Current wiki database table name prefix.
Definition: DefaultSettings.php:2010
$wgFetchCommonsDescriptions
bool $wgFetchCommonsDescriptions
Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:714
$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:705
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:399
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:640
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:136
wfParseUrl
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
Definition: GlobalFunctions.php:796
$wgHashedSharedUploadDirectory
bool $wgHashedSharedUploadDirectory
Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:697
$wgNoReplyAddress
$wgNoReplyAddress
Reply-To address for e-mail notifications.
Definition: DefaultSettings.php:1778
$wgEnotifMaxRecips
$wgEnotifMaxRecips
Definition: Setup.php:434
$wgEmergencyContact
$wgEmergencyContact
Site admin email address.
Definition: DefaultSettings.php:1761
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1033
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:3622
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2447
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:29
$wgFullyInitialised
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition: Setup.php:831
$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
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:462
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:28
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:438
$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:2149
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:8135
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:437
$wgEnableEmail
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
Definition: DefaultSettings.php:1785
$wgLogos
array false $wgLogos
The URL path to various wiki logos.
Definition: DefaultSettings.php:331
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:6540
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:1012
$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
$wgTitle
$wgTitle
Definition: Setup.php:795
$wgUseSharedUploads
bool $wgUseSharedUploads
Shortcut for adding an entry to $wgForeignFileRepos.
Definition: DefaultSettings.php:670
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:9174
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:435
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:3364
$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:498
$wgCacheSharedUploads
bool $wgCacheSharedUploads
Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:742
StubUserLang
Stub object for the user language.
Definition: StubUserLang.php:26
$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:7211
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:80
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:7589
$wgExtensionFunctions
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
Definition: DefaultSettings.php:7710
$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:426
$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:1877
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:8248
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:2010
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:4105
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:441
$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:2782
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:2788
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:1894
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:7162
$wgThumbnailScriptPath
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
Definition: DefaultSettings.php:995
$wgGroupPermissions
$wgGroupPermissions
Permission keys given to users in each group.
Definition: DefaultSettings.php:5550
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:704
$wgLocaltimezone
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Definition: DefaultSettings.php:3353
$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:733
$wgCookieSecure
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
Definition: DefaultSettings.php:6486
$wgShellLocale
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
Definition: DefaultSettings.php:8840
$cpPosInfo
$cpPosInfo
Definition: Setup.php:647
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:8197
$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:1080
$wgDBuser
$wgDBuser
Database username.
Definition: DefaultSettings.php:2025
$wgDBerrorLogTZ
$wgDBerrorLogTZ
Timezone to use in the error log.
Definition: DefaultSettings.php:2261
$wgPasswordPolicy
$wgPasswordPolicy
Password policy for the wiki.
Definition: DefaultSettings.php:4889
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:6610
$wgRequest
if(! $wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:645
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:288
$wgMinimalPasswordLength
$wgMinimalPasswordLength
Specifies the minimal length of a user password.
Definition: DefaultSettings.php:5106
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:564
$wgOut
$wgOut
Definition: Setup.php:782
$wgPasswordSender
$wgPasswordSender
Sender email address for e-mail notifications.
Definition: DefaultSettings.php:1771
$wgPHPSessionHandling
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
Definition: DefaultSettings.php:2673
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3176
$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
$wgContLang
$wgContLang
Definition: Setup.php:696
$wgForeignFileRepos
$wgForeignFileRepos
Enable the use of files from one or more other wikis.
Definition: DefaultSettings.php:629
$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:5369
$wgGenerateThumbnailOnParse
bool $wgGenerateThumbnailOnParse
Render thumbnails while parsing wikitext.
Definition: DefaultSettings.php:1406
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:4296
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:8360
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2556
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:202
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:494
$wgRightsUrl
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki.
Definition: DefaultSettings.php:7576
$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:688