MediaWiki  master
Setup.php
Go to the documentation of this file.
1 <?php
56 use Psr\Log\LoggerInterface;
57 use Wikimedia\RequestTimeout\RequestTimeout;
58 
66 // This file must be included from a valid entry point (e.g. WebStart.php, Maintenance.php)
67 if ( !defined( 'MEDIAWIKI' ) ) {
68  exit( 1 );
69 }
70 
71 // This file must have global scope.
72 $wgScopeTest = 'MediaWiki Setup.php scope test';
73 if ( !isset( $GLOBALS['wgScopeTest'] ) || $GLOBALS['wgScopeTest'] !== $wgScopeTest ) {
74  echo "Error, Setup.php must be included from the file scope.\n";
75  die( 1 );
76 }
77 unset( $wgScopeTest );
78 
79 // PHP must not be configured to overload mbstring functions. (T5782, T122807)
80 // This was deprecated by upstream in PHP 7.2, likely to be removed in PHP 8.0.
81 if ( ini_get( 'mbstring.func_overload' ) ) {
82  die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
83 }
84 
85 // The MW_ENTRY_POINT constant must always exists, to make it safe to access.
86 // For compat, we do support older and custom MW entryoints that don't set this,
87 // in which case we assign a default here.
88 if ( !defined( 'MW_ENTRY_POINT' ) ) {
94  define( 'MW_ENTRY_POINT', 'unknown' );
95 }
96 
103 require_once "$IP/includes/AutoLoader.php";
104 require_once "$IP/includes/Defines.php";
105 require_once "$IP/includes/DefaultSettings.php";
106 require_once "$IP/includes/GlobalFunctions.php";
107 
108 // Load composer's autoloader if present
109 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
110  require_once "$IP/vendor/autoload.php";
111 } elseif ( file_exists( "$IP/vendor/autoload.php" ) ) {
112  die( "$IP/vendor/autoload.php exists but is not readable" );
113 }
114 
115 // Assert that composer dependencies were successfully loaded
116 if ( !interface_exists( LoggerInterface::class ) ) {
117  $message = (
118  'MediaWiki requires the <a href="https://github.com/php-fig/log">PSR-3 logging ' .
119  "library</a> to be present. This library is not embedded directly in MediaWiki's " .
120  "git repository and must be installed separately by the end user.\n\n" .
121  'Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git' .
122  '#Fetch_external_libraries">mediawiki.org</a> for help on installing ' .
123  'the required components.'
124  );
125  echo $message;
126  trigger_error( $message, E_USER_ERROR );
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 if ( $wgMainWANCache === false ) {
250  // Create a WAN cache from $wgMainCacheType
251  $wgMainWANCache = 'mediawiki-main-default';
253  'class' => WANObjectCache::class,
254  'cacheId' => $wgMainCacheType,
255  ];
256 }
257 
258 // Back-compat
259 if ( isset( $wgFileBlacklist ) ) {
260  $wgProhibitedFileExtensions = array_merge( $wgProhibitedFileExtensions, $wgFileBlacklist );
261 } else {
262  $wgFileBlacklist = $wgProhibitedFileExtensions;
263 }
264 if ( isset( $wgMimeTypeBlacklist ) ) {
265  $wgMimeTypeExclusions = array_merge( $wgMimeTypeExclusions, $wgMimeTypeBlacklist );
266 } else {
267  $wgMimeTypeBlacklist = $wgMimeTypeExclusions;
268 }
269 if ( isset( $wgEnableUserEmailBlacklist ) ) {
270  $wgEnableUserEmailMuteList = $wgEnableUserEmailBlacklist;
271 } else {
272  $wgEnableUserEmailBlacklist = $wgEnableUserEmailMuteList;
273 }
274 if ( isset( $wgShortPagesNamespaceBlacklist ) ) {
275  $wgShortPagesNamespaceExclusions = $wgShortPagesNamespaceBlacklist;
276 } else {
277  $wgShortPagesNamespaceBlacklist = $wgShortPagesNamespaceExclusions;
278 }
279 
280 // Prohibited file extensions shouldn't appear on the "allowed" list
282 
283 // Fix path to icon images after they were moved in 1.24
284 if ( $wgRightsIcon ) {
285  $wgRightsIcon = str_replace(
286  "{$wgStylePath}/common/images/",
287  "{$wgResourceBasePath}/resources/assets/licenses/",
289  );
290 }
291 
292 if ( isset( $wgFooterIcons['copyright']['copyright'] )
293  && $wgFooterIcons['copyright']['copyright'] === []
294 ) {
295  if ( $wgRightsIcon || $wgRightsText ) {
296  $wgFooterIcons['copyright']['copyright'] = [
297  'url' => $wgRightsUrl,
298  'src' => $wgRightsIcon,
299  'alt' => $wgRightsText,
300  ];
301  }
302 }
303 
304 if ( isset( $wgFooterIcons['poweredby'] )
305  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
306  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
307 ) {
308  $wgFooterIcons['poweredby']['mediawiki']['src'] =
309  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
310  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
311  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
312  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
313 }
314 
323 
328  'name' => 'fsLockManager',
329  'class' => FSLockManager::class,
330  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
331 ];
332 $wgLockManagers[] = [
333  'name' => 'nullLockManager',
334  'class' => NullLockManager::class,
335 ];
336 
342  'imagesPerRow' => 0,
343  'imageWidth' => 120,
344  'imageHeight' => 120,
345  'captionLength' => true,
346  'showBytes' => true,
347  'showDimensions' => true,
348  'mode' => 'traditional',
349 ];
350 
354 if ( !$wgLocalFileRepo ) {
355  $wgLocalFileRepo = [
356  'class' => LocalRepo::class,
357  'name' => 'local',
358  'directory' => $wgUploadDirectory,
359  'scriptDirUrl' => $wgScriptPath,
361  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
362  'thumbScriptUrl' => $wgThumbnailScriptPath,
363  'transformVia404' => !$wgGenerateThumbnailOnParse,
364  'deletedDir' => $wgDeletedDirectory,
365  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0,
366  'updateCompatibleMetadata' => $wgUpdateCompatibleMetadata,
367  'reserializeMetadata' => $wgUpdateCompatibleMetadata,
368  ];
369 }
370 
371 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
372  // Create a default FileBackend name.
373  // FileBackendGroup will register a default, if absent from $wgFileBackends.
374  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
375 }
376 
380 if ( $wgUseSharedUploads ) {
381  if ( $wgSharedUploadDBname ) {
382  $wgForeignFileRepos[] = [
383  'class' => ForeignDBRepo::class,
384  'name' => 'shared',
385  'directory' => $wgSharedUploadDirectory,
386  'url' => $wgSharedUploadPath,
387  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
388  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
389  'transformVia404' => !$wgGenerateThumbnailOnParse,
390  'dbType' => $wgDBtype,
391  'dbServer' => $wgDBserver,
392  'dbUser' => $wgDBuser,
393  'dbPassword' => $wgDBpassword,
394  'dbName' => $wgSharedUploadDBname,
395  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
396  'tablePrefix' => $wgSharedUploadDBprefix,
397  'hasSharedCache' => $wgCacheSharedUploads,
398  'descBaseUrl' => $wgRepositoryBaseUrl,
399  'fetchDescription' => $wgFetchCommonsDescriptions,
400  ];
401  } else {
402  $wgForeignFileRepos[] = [
403  'class' => FileRepo::class,
404  'name' => 'shared',
405  'directory' => $wgSharedUploadDirectory,
406  'url' => $wgSharedUploadPath,
407  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
408  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
409  'transformVia404' => !$wgGenerateThumbnailOnParse,
410  'descBaseUrl' => $wgRepositoryBaseUrl,
411  'fetchDescription' => $wgFetchCommonsDescriptions,
412  ];
413  }
414 }
415 if ( $wgUseInstantCommons ) {
416  $wgForeignFileRepos[] = [
417  'class' => ForeignAPIRepo::class,
418  'name' => 'wikimediacommons',
419  'apibase' => 'https://commons.wikimedia.org/w/api.php',
420  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
421  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
422  'hashLevels' => 2,
423  'transformVia404' => true,
424  'fetchDescription' => true,
425  'descriptionCacheExpiry' => 43200,
426  'apiThumbCacheExpiry' => 0,
427  ];
428 }
429 foreach ( $wgForeignFileRepos as &$repo ) {
430  if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
431  $repo['directory'] = $wgUploadDirectory; // b/c
432  }
433  if ( !isset( $repo['backend'] ) ) {
434  $repo['backend'] = $repo['name'] . '-backend';
435  }
436 }
437 unset( $repo ); // no global pollution; destroy reference
438 
439 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
440 // Ensure that default user options are not invalid, since that breaks Special:Preferences
441 $wgDefaultUserOptions['rcdays'] = min(
442  $wgDefaultUserOptions['rcdays'],
443  ceil( $rcMaxAgeDays )
444 );
445 $wgDefaultUserOptions['watchlistdays'] = min(
446  $wgDefaultUserOptions['watchlistdays'],
447  ceil( $rcMaxAgeDays )
448 );
449 unset( $rcMaxAgeDays );
450 
451 if ( !$wgCookiePrefix ) {
452  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
454  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
456  } elseif ( $wgDBprefix ) {
458  } else {
460  }
461 }
462 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
463 
464 if ( $wgEnableEmail ) {
466 } else {
467  // Disable all other email settings automatically if $wgEnableEmail
468  // is set to false. - T65678
469  $wgAllowHTMLEmail = false;
470  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
480  unset( $wgGroupPermissions['user']['sendemail'] );
481  $wgUseEnotif = false;
484 }
485 
486 if ( $wgLocaltimezone === null ) {
487  // This defaults to the `date.timezone` value of the PHP INI option. If this option is not set,
488  // it falls back to UTC. Prior to PHP 7.0, this fallback produced a warning.
489  $wgLocaltimezone = date_default_timezone_get();
490 }
491 date_default_timezone_set( $wgLocaltimezone );
492 if ( $wgLocalTZoffset === null ) {
493  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
494 }
495 // The part after the System| is ignored, but rest of MW fills it out as the local offset.
496 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
497 
498 if ( !$wgDBerrorLogTZ ) {
500 }
501 
507 
508 // @todo UGLY UGLY
509 if ( is_array( $wgExtraNamespaces ) ) {
511 }
512 
513 // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php
514 if ( count( $wgDummyLanguageCodes ) !== 0 ) {
515  wfDeprecated( '$wgDummyLanguageCodes', '1.29' );
516 }
517 // Merge in the legacy language codes, incorporating overrides from the config
519  // Internal language codes of the private-use area which get mapped to
520  // themselves.
521  'qqq' => 'qqq', // Used for message documentation
522  'qqx' => 'qqx', // Used for viewing message keys
524 // Merge in (inverted) BCP 47 mappings
525 foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) {
526  $bcp47 = strtolower( $bcp47 ); // force case-insensitivity
527  if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) {
528  $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code;
529  }
530 }
531 unset( $code ); // no global pollution; destroy reference
532 unset( $bcp47 ); // no global pollution; destroy reference
533 
534 // Temporary backwards-compatibility reading of old replica lag settings as of MediaWiki 1.36,
535 // to support sysadmins who fail to update their settings immediately:
536 
537 if ( isset( $wgSlaveLagWarning ) ) {
538  // If the old value is set to something other than the default, use it.
539  if ( $wgDatabaseReplicaLagWarning === 10 && $wgSlaveLagWarning !== 10 ) {
540  $wgDatabaseReplicaLagWarning = $wgSlaveLagWarning;
541  wfDeprecated(
542  '$wgSlaveLagWarning set but $wgDatabaseReplicaLagWarning unchanged; using $wgSlaveLagWarning',
543  '1.36'
544  );
545  }
546 } else {
547  // Backwards-compatibility for extensions that read this value.
548  $wgSlaveLagWarning = $wgDatabaseReplicaLagWarning;
549 }
550 
551 if ( isset( $wgSlaveLagCritical ) ) {
552  // If the old value is set to something other than the default, use it.
553  if ( $wgDatabaseReplicaLagCritical === 30 && $wgSlaveLagCritical !== 30 ) {
554  $wgDatabaseReplicaLagCritical = $wgSlaveLagCritical;
555  wfDeprecated(
556  '$wgSlaveLagCritical set but $wgDatabaseReplicaLagCritical unchanged; using $wgSlaveLagCritical',
557  '1.36'
558  );
559  }
560 } else {
561  // Backwards-compatibility for extensions that read this value.
562  $wgSlaveLagCritical = $wgDatabaseReplicaLagCritical;
563 }
564 
566  Wikimedia\suppressWarnings();
567  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
568  Wikimedia\restoreWarnings();
569 }
570 
571 if ( $wgNewUserLog ) {
572  // Add new user log type
573  $wgLogTypes[] = 'newusers';
574  $wgLogNames['newusers'] = 'newuserlogpage';
575  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
576  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
577  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
578  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
579  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
580  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
581 }
582 
583 if ( $wgPageCreationLog ) {
584  // Add page creation log type
585  $wgLogTypes[] = 'create';
586  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
587 }
588 
589 if ( $wgPageLanguageUseDB ) {
590  $wgLogTypes[] = 'pagelang';
591  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
592 }
593 
594 if ( $wgCookieSecure === 'detect' ) {
596 }
597 
598 // Backwards compatibility with old password limits
599 if ( $wgMinimalPasswordLength !== false ) {
600  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
601 }
602 
603 if ( $wgMaximalPasswordLength !== false ) {
604  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
605 }
606 
607 if ( $wgPHPSessionHandling !== 'enable' &&
608  $wgPHPSessionHandling !== 'warn' &&
609  $wgPHPSessionHandling !== 'disable'
610 ) {
611  $wgPHPSessionHandling = 'warn';
612 }
613 if ( defined( 'MW_NO_SESSION' ) ) {
614  // If the entry point wants no session, force 'disable' here unless they
615  // specifically set it to the (undocumented) 'warn'.
616  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
617 }
618 
620 
621 // Enable the global service locator.
622 // Trivial expansion of site configuration should go before this point.
623 // Any non-trivial expansion that requires calling into MediaWikiServices or other parts of MW.
624 MediaWikiServices::allowGlobalInstance();
625 
626 // Define a constant that indicates that the bootstrapping of the service locator
627 // is complete.
628 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
629 
631 
632 // Non-trivial validation of: $wgServer
633 // The FatalError page only renders cleanly after MWExceptionHandler is installed.
634 if ( $wgServer === false ) {
635  // T30798: $wgServer must be explicitly set
636  throw new FatalError(
637  '$wgServer must be set in LocalSettings.php. ' .
638  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
639  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
640  );
641 }
642 
643 // Non-trivial expansion of: $wgCanonicalServer, $wgServerName.
644 // These require calling global functions.
645 // Also here are other settings that further depend on these two.
646 if ( $wgCanonicalServer === false ) {
648 }
650 
652 if ( $wgServerName !== false ) {
653  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
654  . 'not customized. Overwriting $wgServerName.' );
655 }
657 unset( $serverParts );
658 
659 // $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
660 if ( !$wgEmergencyContact ) {
661  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
662 }
663 if ( !$wgPasswordSender ) {
664  $wgPasswordSender = 'apache@' . $wgServerName;
665 }
666 if ( !$wgNoReplyAddress ) {
668 }
669 
670 // Non-trivial expansion of: $wgSecureLogin
671 // (due to calling wfWarn).
672 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
673  $wgSecureLogin = false;
674  wfWarn( 'Secure login was enabled on a server that only supports '
675  . 'HTTP or HTTPS. Disabling secure login.' );
676 }
677 
678 // Now that GlobalFunctions is loaded, set defaults that depend on it.
679 if ( $wgTmpDirectory === false ) {
681 }
682 
683 if ( $wgSharedDB && $wgSharedTables ) {
684  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
685  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
686  array_fill_keys(
688  [
689  'dbname' => $wgSharedDB,
690  'schema' => $wgSharedSchema,
691  'prefix' => $wgSharedPrefix
692  ]
693  )
694  );
695 }
696 
697 // Raise the memory limit if it's too low
698 // NOTE: This use wfDebug, and must remain after the MWDebug::setup() call.
700 
701 // Initialize the request object in $wgRequest
702 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
703 
704 // Make sure that object caching does not undermine the ChronologyProtector improvements
705 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
706  // The user is pinned to the primary DC, meaning that they made recent changes which should
707  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
708  // they use a blind TTL and could be stale if an object changes twice in a short time span.
709  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
710 }
711 
712 // Useful debug output
713 ( static function () {
715  $logger = LoggerFactory::getInstance( 'wfDebug' );
716  if ( $wgCommandLineMode ) {
717  $self = $_SERVER['PHP_SELF'] ?? '';
718  $logger->debug( "\n\nStart command line script $self" );
719  } else {
720  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
721  $debug .= "IP: " . $wgRequest->getIP() . "\n";
722  $debug .= "HTTP HEADERS:\n";
723  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
724  $debug .= "$name: $value\n";
725  }
726  $debug .= "(end headers)";
727  $logger->debug( $debug );
728  }
729 } )();
730 
731 // Most of the config is out, some might want to run hooks here.
732 Hooks::runner()->onSetupAfterCache();
733 
734 // Now that variant lists may be available, parse any action paths and article paths
735 // as query parameters.
736 //
737 // Skip title interpolation on API queries where it is useless and sometimes harmful (T18019).
738 //
739 // Optimization: Skip on load.php and all other entrypoints besides index.php to save time.
740 //
741 // TODO: Figure out if this can be safely done after everything else in Setup.php (e.g. any
742 // hooks or other state that would miss this?). If so, move to wfIndexMain or MediaWiki::run.
743 if ( MW_ENTRY_POINT === 'index' ) {
744  $wgRequest->interpolateTitle();
745 }
746 
751 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
752  // If session.auto_start is there, we can't touch session name
753  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
754  HeaderCallback::warnIfHeadersSent();
755  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
756  }
757 
758  // Create the SessionManager singleton and set up our session handler,
759  // unless we're specifically asked not to.
760  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
762  MediaWiki\Session\SessionManager::singleton()
763  );
764  }
765 
766  $contLang = MediaWikiServices::getInstance()->getContentLanguage();
767 
768  // Initialize the session
769  try {
771  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
772  // The exception is because the request had multiple possible
773  // sessions tied for top priority. Report this to the user.
774  $list = [];
775  foreach ( $ex->getSessionInfos() as $info ) {
776  $list[] = $info->getProvider()->describe( $contLang );
777  }
778  $list = $contLang->listToText( $list );
779  throw new HttpError( 400,
780  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $contLang )
781  );
782  }
783 
784  unset( $contLang );
785 
786  if ( $session->isPersistent() ) {
787  $wgInitialSessionId = $session->getSessionId();
788  }
789 
790  $session->renew();
791  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
792  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
793  session_id() !== $session->getId()
794  ) {
795  // Start the PHP-session for backwards compatibility
796  if ( session_id() !== '' ) {
797  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
798  'old_id' => session_id(),
799  'new_id' => $session->getId(),
800  ] );
801  session_write_close();
802  }
803  session_id( $session->getId() );
804  session_start();
805  }
806 
807  unset( $session );
808 } else {
809  // Even if we didn't set up a global Session, still install our session
810  // handler unless specifically requested not to.
811  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
813  MediaWiki\Session\SessionManager::singleton()
814  );
815  }
816 }
817 
823 $wgUser = new StubGlobalUser( RequestContext::getMain()->getUser() ); // BackCompat
824 register_shutdown_function( static function () {
826 } );
827 
832 
836 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
837 
842 $wgParser = new DeprecatedGlobal( 'wgParser', static function () {
843  return MediaWikiServices::getInstance()->getParser();
844 }, '1.32' );
845 
849 $wgTitle = null;
850 
851 // Extension setup functions
852 // Entries should be added to this variable during the inclusion
853 // of the extension file. This allows the extension to perform
854 // any necessary initialisation in the fully initialised environment
855 foreach ( $wgExtensionFunctions as $func ) {
856  call_user_func( $func );
857 }
858 unset( $func ); // no global pollution; destroy reference
859 
860 // If the session user has a 0 id but a valid name, that means we need to
861 // autocreate it.
862 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
863  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
864  if ( $sessionUser->getId() === 0 &&
865  MediaWikiServices::getInstance()->getUserNameUtils()->isValid( $sessionUser->getName() )
866  ) {
867  $res = MediaWikiServices::getInstance()->getAuthManager()->autoCreateUser(
868  $sessionUser,
869  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
870  true
871  );
872  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
873  'event' => 'autocreate',
874  'status' => strval( $res ),
875  ] );
876  unset( $res );
877  }
878  unset( $sessionUser );
879 }
880 
881 if ( !$wgCommandLineMode ) {
883 }
884 
886 
887 // T264370
888 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
889  MediaWiki\Session\SessionManager::singleton()->logPotentialSessionLeakage();
890 }
$wgSharedUploadDirectory
string $wgSharedUploadDirectory
Shortcut for the 'directory' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:764
LanguageCode\getDeprecatedCodeMapping
static getDeprecatedCodeMapping()
Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up...
Definition: LanguageCode.php:124
$wgUpdateCompatibleMetadata
$wgUpdateCompatibleMetadata
Shortcut for the 'updateCompatibleMetadata' setting of $wgLocalFileRepo.
Definition: DefaultSettings.php:969
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:483
StubGlobalUser\$destructorDeprecationDisarmed
static bool $destructorDeprecationDisarmed
Definition: StubGlobalUser.php:34
$wgMaximalPasswordLength
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
Definition: DefaultSettings.php:5513
MW_NO_SESSION
const MW_NO_SESSION
Definition: load.php:32
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:2079
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:72
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:9122
$wgParser
$wgParser
Definition: Setup.php:842
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:472
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:3167
$wgRestPath
$wgRestPath
The URL path to the REST API Defaults to "{$wgScriptPath}/rest.php".
Definition: DefaultSettings.php:221
$wgGalleryOptions
$wgGalleryOptions
Default parameters for the "<gallery>" tag.
Definition: Setup.php:341
$wgTmpDirectory
$wgTmpDirectory
The local filesystem path to a temporary directory.
Definition: DefaultSettings.php:454
$wgRightsText
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
Definition: DefaultSettings.php:8317
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:2054
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:441
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:479
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2219
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:193
$wgSharedSchema
$wgSharedSchema
Definition: DefaultSettings.php:2225
$wgRequest
$wgRequest
Definition: Setup.php:702
$wgFileExtensions
$wgFileExtensions
Definition: Setup.php:281
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:8976
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:482
$wgScript
$wgScript
The URL path to index.php.
Definition: DefaultSettings.php:206
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:2099
$wgSharedDB
$wgSharedDB
Shared database for multiple wikis.
Definition: DefaultSettings.php:2208
$wgProhibitedFileExtensions
$wgProhibitedFileExtensions
Files with these extensions will never be allowed as uploads.
Definition: DefaultSettings.php:1114
$wgLocalFileRepo
$wgLocalFileRepo
File repository structures.
Definition: DefaultSettings.php:699
$wgWANObjectCaches
$wgWANObjectCaches
Advanced WAN object cache configuration.
Definition: DefaultSettings.php:2890
$wgSharedUploadDBname
bool string $wgSharedUploadDBname
Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:809
DBO_DEBUG
const DBO_DEBUG
Definition: defines.php:9
wfMemoryLimit
wfMemoryLimit( $newLimit)
Raise PHP's memory limit (if needed).
Definition: GlobalFunctions.php:2390
$wgDBmwschema
$wgDBmwschema
Current wiki database schema name.
Definition: DefaultSettings.php:2064
$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:322
$wgEnableUserEmail
$wgEnableUserEmail
Definition: Setup.php:471
$wgRequestTimeLimit
int null $wgRequestTimeLimit
Set a limit on server request wall clock time.
Definition: DefaultSettings.php:2585
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:243
$serverParts
$serverParts
Definition: Setup.php:651
MWExceptionHandler\installHandler
static installHandler()
Install handlers with PHP.
Definition: MWExceptionHandler.php:67
WebRequest\detectProtocol
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:303
$wgShortPagesNamespaceExclusions
$wgShortPagesNamespaceExclusions
Optional array of namespaces which should be excluded from Special:ShortPages.
Definition: DefaultSettings.php:4710
$wgScopeTest
if(!defined( 'MEDIAWIKI')) $wgScopeTest
Environment checks.
Definition: Setup.php:72
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2733
$wgVirtualRestConfig
if( $wgServer===false) if( $wgCanonicalServer===false) $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:649
$res
$res
Definition: testCompression.php:57
$wgSharedThumbnailScriptPath
string $wgSharedThumbnailScriptPath
Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:1087
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:314
$wgLang
$wgLang
Definition: Setup.php:831
wfDebugLog
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Definition: GlobalFunctions.php:958
$wgMetaNamespace
$wgMetaNamespace
Name of the project namespace.
Definition: DefaultSettings.php:4549
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:32
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:2094
$wgDBprefix
$wgDBprefix
Current wiki database table name prefix.
Definition: DefaultSettings.php:2074
$wgFetchCommonsDescriptions
bool $wgFetchCommonsDescriptions
Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:799
$wgStylePath
$wgStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:228
$debug
$debug
Definition: mcc.php:31
$wgRepositoryBaseUrl
$wgRepositoryBaseUrl
Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:790
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:439
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:725
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:134
$wgCanonicalNamespaceNames
if(! $wgDBerrorLogTZ) $wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:506
wfParseUrl
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
Definition: GlobalFunctions.php:776
$wgHashedSharedUploadDirectory
bool $wgHashedSharedUploadDirectory
Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:782
$wgNoReplyAddress
$wgNoReplyAddress
Reply-To address for e-mail notifications.
Definition: DefaultSettings.php:1842
$wgEnotifMaxRecips
$wgEnotifMaxRecips
Definition: Setup.php:474
$wgEmergencyContact
$wgEmergencyContact
Site admin email address.
Definition: DefaultSettings.php:1825
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Definition: GlobalFunctions.php:997
MediaWiki\Logger\LoggerFactory
PSR-3 logger instance factory.
Definition: LoggerFactory.php:45
$wgFooterIcons
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
Definition: DefaultSettings.php:3918
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2752
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:29
$wgFullyInitialised
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition: Setup.php:885
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:518
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:28
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:478
$wgLoadScript
$wgLoadScript
The URL path to load.php.
Definition: DefaultSettings.php:214
MediaWiki
A helper class for throttling authentication attempts.
$wgEnableUserEmailMuteList
$wgEnableUserEmailMuteList
Set to true to enable user-to-user e-mail mutelist.
Definition: DefaultSettings.php:1872
$wgSharedPrefix
$wgSharedPrefix
Definition: DefaultSettings.php:2213
MediaWiki\Session\SessionManager\singleton
static singleton()
Get the global SessionManager.
Definition: SessionManager.php:133
$wgLogTypes
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
Definition: DefaultSettings.php:8891
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:477
$wgEnableEmail
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
Definition: DefaultSettings.php:1849
$wgLogos
array false $wgLogos
Specification for different versions of the wiki logo.
Definition: DefaultSettings.php:366
$wgCookiePrefix
if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:462
$wgSessionName
$wgSessionName
Override to customise the session name.
Definition: DefaultSettings.php:7210
MWDebug\setup
static setup()
Definition: MWDebug.php:78
$wgMimeTypeExclusions
$wgMimeTypeExclusions
Files with these MIME types will never be allowed as uploads if $wgVerifyMimeType is enabled.
Definition: DefaultSettings.php:1131
$wgCanonicalServer
$wgCanonicalServer
Canonical URL of the server, to use in IRC feeds and notification e-mails.
Definition: DefaultSettings.php:119
$wgHashedUploadDirectory
bool $wgHashedUploadDirectory
Shortcut for setting hashLevels=2 in $wgLocalFileRepo.
Definition: DefaultSettings.php:1095
$wgEnotifRevealEditorAddress
$wgEnotifRevealEditorAddress
Definition: Setup.php:476
$wgMemoryLimit
$wgMemoryLimit
The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit i...
Definition: DefaultSettings.php:2654
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:327
$wgDatabaseReplicaLagWarning
$wgDatabaseReplicaLagWarning
If lag is higher than $wgDatabaseReplicaLagWarning, show a warning in some special pages (like watchl...
Definition: DefaultSettings.php:2353
$wgTitle
$wgTitle
Definition: Setup.php:849
$wgUseSharedUploads
bool $wgUseSharedUploads
Shortcut for adding an entry to $wgForeignFileRepos.
Definition: DefaultSettings.php:755
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:2546
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:475
MediaWiki\Session\SessionManager\getGlobalSession
static getGlobalSession()
If PHP's session_id() has been set, returns that session.
Definition: SessionManager.php:146
$wgLocalTZoffset
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
Definition: DefaultSettings.php:3709
$wgForceHTTPS
bool $wgForceHTTPS
If this is true, when an insecure HTTP request is received, always redirect to HTTPS.
Definition: DefaultSettings.php:167
$wgDeletedDirectory
$wgDeletedDirectory
What directory to place deleted uploads in.
Definition: DefaultSettings.php:552
$wgCacheSharedUploads
bool $wgCacheSharedUploads
Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:827
StubUserLang
Stub object for the user language.
Definition: StubUserLang.php:24
MediaWiki\HeaderCallback
Definition: HeaderCallback.php:8
$wgServer
$wgServer
URL of the server.
Definition: DefaultSettings.php:110
DeprecatedGlobal
Class to allow throwing wfDeprecated warnings when people use globals that we do not want them to.
Definition: DeprecatedGlobal.php:27
Hooks\runner
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
Definition: Hooks.php:173
$wgRCMaxAge
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
Definition: DefaultSettings.php:7901
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:82
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:8322
$wgExtensionFunctions
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
Definition: DefaultSettings.php:8449
$wgEmailAuthentication
$wgEmailAuthentication
Definition: Setup.php:470
$wgUploadBaseUrl
$wgUploadBaseUrl
If set, this URL is added to the start of $wgUploadPath to form a complete upload URL.
Definition: DefaultSettings.php:461
$wgUploadDirectory
$wgUploadDirectory
The filesystem path of the images directory.
Definition: DefaultSettings.php:299
$wgAllowHTMLEmail
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
Definition: DefaultSettings.php:1941
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:484
$wgLogActionsHandlers
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
Definition: DefaultSettings.php:9004
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:1870
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:4411
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:481
$wgArticlePath
$wgArticlePath
The URL path for primary article page views.
Definition: DefaultSettings.php:266
$self
$self
Definition: doMaintenance.php:63
$wgCacheEpoch
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
Definition: DefaultSettings.php:3098
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:3104
Message\newFromKey
static newFromKey( $key,... $params)
Factory function that is just wrapper for the real constructor.
Definition: Message.php:380
wfTempDir
wfTempDir()
Tries to get the system directory for temporary files.
Definition: GlobalFunctions.php:1754
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:7852
$wgThumbnailScriptPath
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
Definition: DefaultSettings.php:1078
$wgInitialSessionId
if(MW_ENTRY_POINT==='index') MediaWiki Session SessionId null $wgInitialSessionId
The persistent session ID (if any) loaded at startup.
Definition: Setup.php:750
$wgGroupPermissions
$wgGroupPermissions
Permission keys given to users in each group.
Definition: DefaultSettings.php:5953
FatalError
Abort the web request with a custom HTML string that will represent the entire response.
Definition: FatalError.php:37
$wgLocaltimezone
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Definition: DefaultSettings.php:3698
$wgEnotifImpersonal
$wgEnotifImpersonal
Definition: Setup.php:473
$wgSharedUploadDBprefix
string $wgSharedUploadDBprefix
Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:818
$wgCookieSecure
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
Definition: DefaultSettings.php:7156
$wgShellLocale
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
Definition: DefaultSettings.php:9566
StubGlobalUser
Stub object for the global user ($wgUser) that makes it possible to change the relevant underlying ob...
Definition: StubGlobalUser.php:31
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:8953
$wgFileCacheDirectory
$wgFileCacheDirectory
Directory where the cached page will be saved.
Definition: DefaultSettings.php:305
$wgUploadPath
$wgUploadPath
The URL path for the images directory.
Definition: DefaultSettings.php:272
wfWarn
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
Definition: GlobalFunctions.php:1043
$wgDBuser
$wgDBuser
Database username.
Definition: DefaultSettings.php:2089
$wgDBerrorLogTZ
$wgDBerrorLogTZ
Timezone to use in the error log.
Definition: DefaultSettings.php:2329
$wgPasswordPolicy
$wgPasswordPolicy
Password policy for the wiki.
Definition: DefaultSettings.php:5268
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:7280
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:5500
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:656
$wgOut
$wgOut
Definition: Setup.php:836
$wgPasswordSender
$wgPasswordSender
Sender email address for e-mail notifications.
Definition: DefaultSettings.php:1835
$wgPHPSessionHandling
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
Definition: DefaultSettings.php:2989
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3502
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:178
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:714
$wgLocalStylePath
$wgLocalStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:236
$wgSecureLogin
$wgSecureLogin
This is to let user authenticate using https when they come from http.
Definition: DefaultSettings.php:5764
$wgGenerateThumbnailOnParse
bool $wgGenerateThumbnailOnParse
Render thumbnails while parsing wikitext.
Definition: DefaultSettings.php:1483
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:4593
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:9116
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2863
$wgDatabaseReplicaLagCritical
$wgDatabaseReplicaLagCritical
Definition: DefaultSettings.php:2360
MW_ENTRY_POINT
const MW_ENTRY_POINT
Definition: api.php:41
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:192
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:474
$wgRightsUrl
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki.
Definition: DefaultSettings.php:8309
$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:197
$wgSharedUploadPath
string $wgSharedUploadPath
Shortcut for the 'url' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:773