MediaWiki  1.34.0
Setup.php
Go to the documentation of this file.
1 <?php
29 
34 if ( !defined( 'MEDIAWIKI' ) ) {
35  exit( 1 );
36 }
37 
38 // Check to see if we are at the file scope
39 $wgScopeTest = 'MediaWiki Setup.php scope test';
40 if ( !isset( $GLOBALS['wgScopeTest'] ) || $GLOBALS['wgScopeTest'] !== $wgScopeTest ) {
41  echo "Error, Setup.php must be included from the file scope.\n";
42  die( 1 );
43 }
44 unset( $wgScopeTest );
45 
50 // Sanity check (T5782, T122807)
51 if ( ini_get( 'mbstring.func_overload' ) ) {
52  die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
53 }
54 
55 // Define MW_ENTRY_POINT if it's not already, so that config code can check the
56 // value without using defined()
57 if ( !defined( 'MW_ENTRY_POINT' ) ) {
63  define( 'MW_ENTRY_POINT', 'unknown' );
64 }
65 
66 // Start the autoloader, so that extensions can derive classes from core files
67 require_once "$IP/includes/AutoLoader.php";
68 
69 // Load global constants
70 require_once "$IP/includes/Defines.php";
71 
72 // Load default settings
73 require_once "$IP/includes/DefaultSettings.php";
74 
75 // Load global functions
76 require_once "$IP/includes/GlobalFunctions.php";
77 
78 // Load composer's autoloader if present
79 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
80  require_once "$IP/vendor/autoload.php";
81 } elseif ( file_exists( "$IP/vendor/autoload.php" ) ) {
82  die( "$IP/vendor/autoload.php exists but is not readable" );
83 }
84 
85 // Assert that composer dependencies were successfully loaded
86 // Purposely no leading \ due to it breaking HHVM RepoAuthorative mode
87 // PHP works fine with both versions
88 // See https://github.com/facebook/hhvm/issues/5833
89 if ( !interface_exists( 'Psr\Log\LoggerInterface' ) ) {
90  $message = (
91  'MediaWiki requires the <a href="https://github.com/php-fig/log">PSR-3 logging ' .
92  "library</a> to be present. This library is not embedded directly in MediaWiki's " .
93  "git repository and must be installed separately by the end user.\n\n" .
94  'Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git' .
95  '#Fetch_external_libraries">mediawiki.org</a> for help on installing ' .
96  'the required components.'
97  );
98  echo $message;
99  trigger_error( $message, E_USER_ERROR );
100  die( 1 );
101 }
102 
107 // Install a header callback
109 
110 // Set the encoding used by PHP for reading HTTP input, and writing output.
111 // This is also the default for mbstring functions.
112 mb_internal_encoding( 'UTF-8' );
113 
118 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
119  call_user_func( MW_CONFIG_CALLBACK );
120 } else {
121  if ( !defined( 'MW_CONFIG_FILE' ) ) {
122  define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
123  }
124  require_once MW_CONFIG_FILE;
125 }
126 
134 if ( defined( 'MW_SETUP_CALLBACK' ) ) {
135  call_user_func( MW_SETUP_CALLBACK );
136 }
137 
142 // Load queued extensions
143 ExtensionRegistry::getInstance()->loadFromQueue();
144 // Don't let any other extensions load
146 
147 // Set the configured locale on all requests for consisteny
148 putenv( "LC_ALL=$wgShellLocale" );
149 setlocale( LC_ALL, $wgShellLocale );
150 
151 // Set various default paths sensibly...
152 if ( $wgScript === false ) {
153  $wgScript = "$wgScriptPath/index.php";
154 }
155 if ( $wgLoadScript === false ) {
156  $wgLoadScript = "$wgScriptPath/load.php";
157 }
158 if ( $wgRestPath === false ) {
159  $wgRestPath = "$wgScriptPath/rest.php";
160 }
161 
162 if ( $wgArticlePath === false ) {
163  if ( $wgUsePathInfo ) {
164  $wgArticlePath = "$wgScript/$1";
165  } else {
166  $wgArticlePath = "$wgScript?title=$1";
167  }
168 }
169 
170 if ( $wgResourceBasePath === null ) {
172 }
173 if ( $wgStylePath === false ) {
174  $wgStylePath = "$wgResourceBasePath/skins";
175 }
176 if ( $wgLocalStylePath === false ) {
177  // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
178  $wgLocalStylePath = "$wgScriptPath/skins";
179 }
180 if ( $wgExtensionAssetsPath === false ) {
181  $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
182 }
183 
184 if ( $wgLogo === false ) {
185  $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
186 }
187 
188 if ( $wgUploadPath === false ) {
189  $wgUploadPath = "$wgScriptPath/images";
190 }
191 if ( $wgUploadDirectory === false ) {
192  $wgUploadDirectory = "$IP/images";
193 }
194 if ( $wgReadOnlyFile === false ) {
195  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
196 }
197 if ( $wgFileCacheDirectory === false ) {
198  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
199 }
200 if ( $wgDeletedDirectory === false ) {
201  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
202 }
203 
204 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
205  $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
206 }
207 
208 // Fix path to icon images after they were moved in 1.24
209 if ( $wgRightsIcon ) {
210  $wgRightsIcon = str_replace(
211  "{$wgStylePath}/common/images/",
212  "{$wgResourceBasePath}/resources/assets/licenses/",
214  );
215 }
216 
217 if ( isset( $wgFooterIcons['copyright']['copyright'] )
218  && $wgFooterIcons['copyright']['copyright'] === []
219 ) {
220  if ( $wgRightsIcon || $wgRightsText ) {
221  $wgFooterIcons['copyright']['copyright'] = [
222  'url' => $wgRightsUrl,
223  'src' => $wgRightsIcon,
224  'alt' => $wgRightsText,
225  ];
226  }
227 }
228 
229 if ( isset( $wgFooterIcons['poweredby'] )
230  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
231  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
232 ) {
233  $wgFooterIcons['poweredby']['mediawiki']['src'] =
234  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
235  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
236  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
237  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
238 }
239 
248 
256 
261  'name' => 'fsLockManager',
262  'class' => FSLockManager::class,
263  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
264 ];
265 $wgLockManagers[] = [
266  'name' => 'nullLockManager',
267  'class' => NullLockManager::class,
268 ];
269 
275  'imagesPerRow' => 0,
276  'imageWidth' => 120,
277  'imageHeight' => 120,
278  'captionLength' => true,
279  'showBytes' => true,
280  'showDimensions' => true,
281  'mode' => 'traditional',
282 ];
283 
287 if ( !$wgLocalFileRepo ) {
288  $wgLocalFileRepo = [
289  'class' => LocalRepo::class,
290  'name' => 'local',
291  'directory' => $wgUploadDirectory,
292  'scriptDirUrl' => $wgScriptPath,
294  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
295  'thumbScriptUrl' => $wgThumbnailScriptPath,
296  'transformVia404' => !$wgGenerateThumbnailOnParse,
297  'deletedDir' => $wgDeletedDirectory,
298  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0
299  ];
300 }
301 
302 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
303  // Create a default FileBackend name.
304  // FileBackendGroup will register a default, if absent from $wgFileBackends.
305  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
306 }
307 
311 if ( $wgUseSharedUploads ) {
312  if ( $wgSharedUploadDBname ) {
313  $wgForeignFileRepos[] = [
314  'class' => ForeignDBRepo::class,
315  'name' => 'shared',
316  'directory' => $wgSharedUploadDirectory,
317  'url' => $wgSharedUploadPath,
318  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
319  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
320  'transformVia404' => !$wgGenerateThumbnailOnParse,
321  'dbType' => $wgDBtype,
322  'dbServer' => $wgDBserver,
323  'dbUser' => $wgDBuser,
324  'dbPassword' => $wgDBpassword,
325  'dbName' => $wgSharedUploadDBname,
326  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
327  'tablePrefix' => $wgSharedUploadDBprefix,
328  'hasSharedCache' => $wgCacheSharedUploads,
329  'descBaseUrl' => $wgRepositoryBaseUrl,
330  'fetchDescription' => $wgFetchCommonsDescriptions,
331  ];
332  } else {
333  $wgForeignFileRepos[] = [
334  'class' => FileRepo::class,
335  'name' => 'shared',
336  'directory' => $wgSharedUploadDirectory,
337  'url' => $wgSharedUploadPath,
338  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
339  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
340  'transformVia404' => !$wgGenerateThumbnailOnParse,
341  'descBaseUrl' => $wgRepositoryBaseUrl,
342  'fetchDescription' => $wgFetchCommonsDescriptions,
343  ];
344  }
345 }
346 if ( $wgUseInstantCommons ) {
347  $wgForeignFileRepos[] = [
348  'class' => ForeignAPIRepo::class,
349  'name' => 'wikimediacommons',
350  'apibase' => 'https://commons.wikimedia.org/w/api.php',
351  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
352  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
353  'hashLevels' => 2,
354  'transformVia404' => true,
355  'fetchDescription' => true,
356  'descriptionCacheExpiry' => 43200,
357  'apiThumbCacheExpiry' => 0,
358  ];
359 }
360 foreach ( $wgForeignFileRepos as &$repo ) {
361  if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
362  $repo['directory'] = $wgUploadDirectory; // b/c
363  }
364  if ( !isset( $repo['backend'] ) ) {
365  $repo['backend'] = $repo['name'] . '-backend';
366  }
367 }
368 unset( $repo ); // no global pollution; destroy reference
369 
370 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
371 // Ensure that default user options are not invalid, since that breaks Special:Preferences
372 $wgDefaultUserOptions['rcdays'] = min(
373  $wgDefaultUserOptions['rcdays'],
374  ceil( $rcMaxAgeDays )
375 );
376 $wgDefaultUserOptions['watchlistdays'] = min(
377  $wgDefaultUserOptions['watchlistdays'],
378  ceil( $rcMaxAgeDays )
379 );
380 unset( $rcMaxAgeDays );
381 
382 if ( $wgSkipSkin ) {
383  // Hard deprecated in 1.34.
384  wfDeprecated( '$wgSkipSkin – use $wgSkipSkins instead', '1.23' );
386 }
387 
388 $wgSkipSkins[] = 'fallback';
389 $wgSkipSkins[] = 'apioutput';
390 
391 if ( $wgLocalInterwiki ) {
392  // Hard deprecated in 1.34.
393  wfDeprecated( '$wgLocalInterwiki – use $wgLocalInterwikis instead', '1.23' );
394  // @phan-suppress-next-line PhanUndeclaredVariableDim
395  array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
396 }
397 
398 // Set default shared prefix
399 if ( $wgSharedPrefix === false ) {
401 }
402 
403 // Set default shared schema
404 if ( $wgSharedSchema === false ) {
406 }
407 
408 if ( !$wgCookiePrefix ) {
409  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
411  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
413  } elseif ( $wgDBprefix ) {
415  } else {
417  }
418 }
419 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
420 
421 if ( $wgEnableEmail ) {
423 } else {
424  // Disable all other email settings automatically if $wgEnableEmail
425  // is set to false. - T65678
426  $wgAllowHTMLEmail = false;
427  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
437  unset( $wgGroupPermissions['user']['sendemail'] );
438  $wgUseEnotif = false;
441 }
442 
443 // $wgSysopEmailBans deprecated in 1.34
444 if ( isset( $wgSysopEmailBans ) && $wgSysopEmailBans === false ) {
445  wfDeprecated( 'wgSysopEmailBans', '1.34' );
446  foreach ( $wgGroupPermissions as $group => $_ ) {
447  unset( $wgGroupPermissions[$group]['blockemail'] );
448  }
449 }
450 
451 if ( $wgMetaNamespace === false ) {
452  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
453 }
454 
455 // Ensure the minimum chunk size is less than PHP upload limits or the maximum
456 // upload size.
459  UploadBase::getMaxUploadSize( 'file' ),
460  UploadBase::getMaxPhpUploadSize(),
462  ini_get( 'post_max_size' ) ?: ini_get( 'hhvm.server.max_post_size' ),
463  PHP_INT_MAX
464  ) ?: PHP_INT_MAX ) - 1024 // Leave some room for other POST parameters
465 );
466 
472 
474 if ( is_array( $wgExtraNamespaces ) ) {
476 }
477 
478 // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php
479 if ( count( $wgDummyLanguageCodes ) !== 0 ) {
480  wfDeprecated( '$wgDummyLanguageCodes', '1.29' );
481 }
482 // Merge in the legacy language codes, incorporating overrides from the config
484  // Internal language codes of the private-use area which get mapped to
485  // themselves.
486  'qqq' => 'qqq', // Used for message documentation
487  'qqx' => 'qqx', // Used for viewing message keys
489 // Merge in (inverted) BCP 47 mappings
490 foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) {
491  $bcp47 = strtolower( $bcp47 ); // force case-insensitivity
492  if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) {
493  $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code;
494  }
495 }
496 
497 // These are now the same, always
498 // To determine the user language, use $wgLang->getCode()
500 
501 // Temporary backwards-compatibility reading of old Squid-named CDN settings as of MediaWiki 1.34,
502 // to support sysadmins who fail to update their settings immediately:
503 
504 if ( isset( $wgUseSquid ) ) {
505  // If the sysadmin is still setting a value of $wgUseSquid to true but $wgUseCdn is the default of
506  // false, to be safe, assume they do want this still, so enable it.
507  if ( !$wgUseCdn && $wgUseSquid ) {
508  $wgUseCdn = $wgUseSquid;
509  wfDeprecated( '$wgUseSquid enabled but $wgUseCdn disabled; enabling CDN functions', '1.34' );
510  }
511 } else {
512  // Backwards-compatibility for extensions that read this value.
513  $wgUseSquid = $wgUseCdn;
514 }
515 
516 if ( isset( $wgSquidServers ) ) {
517  // If the sysadmin is still setting a value of $wgSquidServers but $wgCdnServers is the default of
518  // empty, to be safe, assume they do want these servers to be still used, so use them.
519  if ( !empty( $wgSquidServers ) && empty( $wgCdnServers ) ) {
520  $wgCdnServers = $wgSquidServers;
521  wfDeprecated( '$wgSquidServers set, $wgCdnServers empty; using them', '1.34' );
522  }
523 } else {
524  // Backwards-compatibility for extensions that read this value.
525  $wgSquidServers = $wgCdnServers;
526 }
527 
528 if ( isset( $wgSquidServersNoPurge ) ) {
529  // If the sysadmin is still setting values in $wgSquidServersNoPurge but $wgCdnServersNoPurge is
530  // the default of empty, to be safe, assume they do want these servers to be still used, so use
531  // them.
532  if ( !empty( $wgSquidServersNoPurge ) && empty( $wgCdnServersNoPurge ) ) {
533  $wgCdnServersNoPurge = $wgSquidServersNoPurge;
534  wfDeprecated( '$wgSquidServersNoPurge set, $wgCdnServersNoPurge empty; using them', '1.34' );
535  }
536 } else {
537  // Backwards-compatibility for extensions that read this value.
538  $wgSquidServersNoPurge = $wgCdnServersNoPurge;
539 }
540 
541 if ( isset( $wgSquidMaxage ) ) {
542  // If the sysadmin is still setting a value of $wgSquidMaxage and it's higher than $wgCdnMaxAge,
543  // to be safe, assume they want the higher (lower performance requirement) value, so use that.
544  if ( $wgCdnMaxAge < $wgSquidMaxage ) {
545  $wgCdnMaxAge = $wgSquidMaxage;
546  wfDeprecated( '$wgSquidMaxage set higher than $wgCdnMaxAge; using the higher value', '1.34' );
547  }
548 } else {
549  // Backwards-compatibility for extensions that read this value.
550  $wgSquidMaxage = $wgCdnMaxAge;
551 }
552 
553 // Blacklisted file extensions shouldn't appear on the "allowed" list
554 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
555 
557  Wikimedia\suppressWarnings();
558  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
559  Wikimedia\restoreWarnings();
560 }
561 
562 if ( $wgNewUserLog ) {
563  // Add new user log type
564  $wgLogTypes[] = 'newusers';
565  $wgLogNames['newusers'] = 'newuserlogpage';
566  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
567  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
568  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
569  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
570  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
571  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
572 }
573 
574 if ( $wgPageCreationLog ) {
575  // Add page creation log type
576  $wgLogTypes[] = 'create';
577  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
578 }
579 
580 if ( $wgPageLanguageUseDB ) {
581  $wgLogTypes[] = 'pagelang';
582  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
583 }
584 
585 if ( $wgCookieSecure === 'detect' ) {
586  $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
587 }
588 
589 if ( $wgProfileOnly ) {
590  // Hard deprecated in 1.34.
591  wfDeprecated(
592  '$wgProfileOnly set the log file in $wgDebugLogGroups[\'profileoutput\'] instead',
593  '1.23'
594  );
595  $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
596  $wgDebugLogFile = '';
597 }
598 
599 // Backwards compatibility with old password limits
600 if ( $wgMinimalPasswordLength !== false ) {
601  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
602 }
603 
604 if ( $wgMaximalPasswordLength !== false ) {
605  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
606 }
607 
608 if ( $wgPHPSessionHandling !== 'enable' &&
609  $wgPHPSessionHandling !== 'warn' &&
610  $wgPHPSessionHandling !== 'disable'
611 ) {
612  $wgPHPSessionHandling = 'warn';
613 }
614 if ( defined( 'MW_NO_SESSION' ) ) {
615  // If the entry point wants no session, force 'disable' here unless they
616  // specifically set it to the (undocumented) 'warn'.
617  // @phan-suppress-next-line PhanUndeclaredConstant
618  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
619 }
620 
622 
623 // Reset the global service locator, so any services that have already been created will be
624 // re-created while taking into account any custom settings and extensions.
625 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
626 
627 // Define a constant that indicates that the bootstrapping of the service locator
628 // is complete.
629 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
630 
632 
633 // T30798: $wgServer must be explicitly set
634 if ( $wgServer === false ) {
635  throw new FatalError(
636  '$wgServer must be set in LocalSettings.php. ' .
637  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
638  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
639  );
640 }
641 
642 // T48998: Bail out early if $wgArticlePath is non-absolute
643 foreach ( [ 'wgArticlePath', 'wgVariantArticlePath' ] as $varName ) {
644  if ( $$varName && !preg_match( '/^(https?:\/\/|\/)/', $$varName ) ) {
645  throw new FatalError(
646  "If you use a relative URL for \$$varName, it must start " .
647  'with a slash (<code>/</code>).<br><br>See ' .
648  "<a href=\"https://www.mediawiki.org/wiki/Manual:\$$varName\">" .
649  "https://www.mediawiki.org/wiki/Manual:\$$varName</a>."
650  );
651  }
652 }
653 
654 if ( $wgCanonicalServer === false ) {
656 }
657 
658 // Set server name
660 if ( $wgServerName !== false ) {
661  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
662  . 'not customized. Overwriting $wgServerName.' );
663 }
665 unset( $serverParts );
666 
667 // Set defaults for configuration variables
668 // that are derived from the server name by default
669 // Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
670 if ( !$wgEmergencyContact ) {
671  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
672 }
673 if ( !$wgPasswordSender ) {
674  $wgPasswordSender = 'apache@' . $wgServerName;
675 }
676 if ( !$wgNoReplyAddress ) {
678 }
679 
680 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
681  $wgSecureLogin = false;
682  wfWarn( 'Secure login was enabled on a server that only supports '
683  . 'HTTP or HTTPS. Disabling secure login.' );
684 }
685 
687 
688 // Now that GlobalFunctions is loaded, set defaults that depend on it.
689 if ( $wgTmpDirectory === false ) {
691 }
692 
693 // We don't use counters anymore. Left here for extensions still
694 // expecting this to exist. Should be removed sometime 1.26 or later.
695 if ( !isset( $wgDisableCounters ) ) {
696  $wgDisableCounters = true;
697 }
698 
699 if ( $wgMainWANCache === false ) {
700  // Setup a WAN cache from $wgMainCacheType with no relayer.
701  // Sites using multiple datacenters can configure a relayer.
702  $wgMainWANCache = 'mediawiki-main-default';
704  'class' => WANObjectCache::class,
705  'cacheId' => $wgMainCacheType
706  ];
707 }
708 
709 if ( $wgSharedDB && $wgSharedTables ) {
710  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
711  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
712  array_fill_keys(
714  [
715  'dbname' => $wgSharedDB,
716  'schema' => $wgSharedSchema,
717  'prefix' => $wgSharedPrefix
718  ]
719  )
720  );
721 }
722 
723 // Raise the memory limit if it's too low
724 // Note, this makes use of wfDebug, and thus should not be before
725 // MWDebug::init() is called.
727 
733 if ( is_null( $wgLocaltimezone ) ) {
734  Wikimedia\suppressWarnings();
735  $wgLocaltimezone = date_default_timezone_get();
736  Wikimedia\restoreWarnings();
737 }
738 
739 date_default_timezone_set( $wgLocaltimezone );
740 if ( is_null( $wgLocalTZoffset ) ) {
741  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
742 }
743 // The part after the System| is ignored, but rest of MW fills it
744 // out as the local offset.
745 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
746 
747 if ( !$wgDBerrorLogTZ ) {
749 }
750 
751 // Initialize the request object in $wgRequest
752 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
753 // Set user IP/agent information for agent session consistency purposes
754 $cpPosInfo = LBFactory::getCPInfoFromCookieValue(
755  // The cookie has no prefix and is set by MediaWiki::preOutputCommit()
756  $wgRequest->getCookie( 'cpPosIndex', '' ),
757  // Mitigate broken client-side cookie expiration handling (T190082)
758  time() - ChronologyProtector::POSITION_COOKIE_TTL
759 );
760 MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
761  'IPAddress' => $wgRequest->getIP(),
762  'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
763  'ChronologyProtection' => $wgRequest->getHeader( 'MediaWiki-Chronology-Protection' ),
764  'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ),
765  'ChronologyClientId' => $cpPosInfo['clientId']
766  ?? $wgRequest->getHeader( 'MediaWiki-Chronology-Client-Id' )
767 ] );
768 unset( $cpPosInfo );
769 // Make sure that object caching does not undermine the ChronologyProtector improvements
770 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
771  // The user is pinned to the primary DC, meaning that they made recent changes which should
772  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
773  // they use a blind TTL and could be stale if an object changes twice in a short time span.
774  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
775 }
776 
777 // Useful debug output
778 if ( $wgCommandLineMode ) {
779  if ( isset( $self ) ) {
780  wfDebug( "\n\nStart command line script $self\n" );
781  }
782 } else {
783  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
784  $debug .= "HTTP HEADERS:\n";
785  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
786  $debug .= "$name: $value\n";
787  }
788  wfDebug( $debug );
789 }
790 
793 
794 // Most of the config is out, some might want to run hooks here.
795 Hooks::run( 'SetupAfterCache' );
796 
801 $wgContLang = MediaWikiServices::getInstance()->getContentLanguage();
802 
803 // Now that variant lists may be available...
804 $wgRequest->interpolateTitle();
805 
811 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
812  // If session.auto_start is there, we can't touch session name
813  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
814  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
815  }
816 
817  // Create the SessionManager singleton and set up our session handler,
818  // unless we're specifically asked not to.
819  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
821  MediaWiki\Session\SessionManager::singleton()
822  );
823  }
824 
825  // Initialize the session
826  try {
828  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
829  // The exception is because the request had multiple possible
830  // sessions tied for top priority. Report this to the user.
831  $list = [];
832  foreach ( $ex->getSessionInfos() as $info ) {
833  $list[] = $info->getProvider()->describe( $wgContLang );
834  }
835  $list = $wgContLang->listToText( $list );
836  throw new HttpError( 400,
837  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
838  );
839  }
840 
841  if ( $session->isPersistent() ) {
842  $wgInitialSessionId = $session->getSessionId();
843  }
844 
845  $session->renew();
846  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
847  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
848  session_id() !== $session->getId()
849  ) {
850  // Start the PHP-session for backwards compatibility
851  if ( session_id() !== '' ) {
852  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
853  'old_id' => session_id(),
854  'new_id' => $session->getId(),
855  ] );
856  session_write_close();
857  }
858  session_id( $session->getId() );
859  session_start();
860  }
861 
862  unset( $session );
863 } else {
864  // Even if we didn't set up a global Session, still install our session
865  // handler unless specifically requested not to.
866  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
868  MediaWiki\Session\SessionManager::singleton()
869  );
870  }
871 }
872 
876 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
877 
882 
886 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
887 
892 $wgParser = new StubObject( 'wgParser', function () {
893  return MediaWikiServices::getInstance()->getParser();
894 } );
895 
899 $wgTitle = null;
900 
901 // Extension setup functions
902 // Entries should be added to this variable during the inclusion
903 // of the extension file. This allows the extension to perform
904 // any necessary initialisation in the fully initialised environment
905 foreach ( $wgExtensionFunctions as $func ) {
906  call_user_func( $func );
907 }
908 
909 // If the session user has a 0 id but a valid name, that means we need to
910 // autocreate it.
911 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
912  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
913  if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
914  $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
915  $sessionUser,
916  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
917  true
918  );
919  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
920  'event' => 'autocreate',
921  'status' => $res,
922  ] );
923  unset( $res );
924  }
925  unset( $sessionUser );
926 }
927 
928 if ( !$wgCommandLineMode ) {
930 }
931 
$wgCanonicalNamespaceNames
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:471
$wgSharedUploadDirectory
string $wgSharedUploadDirectory
Shortcut for the 'directory' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:604
$wgLocalInterwiki
$wgLocalInterwiki
The interwiki prefix of the current wiki, or false if it doesn't have one.
Definition: DefaultSettings.php:3925
LanguageCode\getDeprecatedCodeMapping
static getDeprecatedCodeMapping()
Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up...
Definition: LanguageCode.php:127
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
$wgUseCdn
$wgUseCdn
Enable/disable CDN.
Definition: DefaultSettings.php:2751
$wgUsersNotifiedOnAllChanges
$wgUsersNotifiedOnAllChanges
Definition: Setup.php:440
$wgMaximalPasswordLength
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
Definition: DefaultSettings.php:4699
MW_NO_SESSION
const MW_NO_SESSION
Definition: load.php:29
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:1918
$wgFileBlacklist
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
Definition: DefaultSettings.php:949
ObjectCache\getLocalClusterInstance
static getLocalClusterInstance()
Get the main cluster-local cache object.
Definition: ObjectCache.php:342
$wgCdnServers
$wgCdnServers
List of proxy servers to purge on changes; default port is 80.
Definition: DefaultSettings.php:2832
$wgProfileOnly
$wgProfileOnly
Don't put non-profiling info into log file.
Definition: DefaultSettings.php:6437
$wgCookiePrefix
if( $wgLocalInterwiki) if( $wgSharedPrefix===false) if( $wgSharedSchema===false) if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:419
$wgSysopEmailBans
$wgSysopEmailBans
Allow sysops to ban users from accessing Emailuser.
Definition: DefaultSettings.php:4999
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:7923
$wgParser
$wgParser
Definition: Setup.php:892
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:429
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:2709
$wgRestPath
$wgRestPath
The URL path to the REST API Defaults to "{$wgScriptPath}/rest.php".
Definition: DefaultSettings.php:200
$wgGalleryOptions
$wgGalleryOptions
Default parameters for the "<gallery>" tag.
Definition: Setup.php:274
$wgTmpDirectory
$wgTmpDirectory
The local filesystem path to a temporary directory.
Definition: DefaultSettings.php:352
$wgRightsText
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
Definition: DefaultSettings.php:7164
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:1893
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:372
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:436
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2047
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:117
$wgSharedSchema
$wgSharedSchema
Definition: DefaultSettings.php:2053
StubObject
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition: StubObject.php:45
$wgFileExtensions
$wgFileExtensions
Definition: Setup.php:554
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:7778
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:439
$wgScript
$wgScript
The URL path to index.php.
Definition: DefaultSettings.php:185
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:1938
$wgSharedDB
$wgSharedDB
Shared database for multiple wikis.
Definition: DefaultSettings.php:2037
$wgLocalFileRepo
$wgLocalFileRepo
File repository structures.
Definition: DefaultSettings.php:539
$wgWANObjectCaches
$wgWANObjectCaches
Advanced WAN object cache configuration.
Definition: DefaultSettings.php:2454
$wgSharedUploadDBname
bool string $wgSharedUploadDBname
Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:649
DBO_DEBUG
const DBO_DEBUG
Definition: defines.php:9
wfMemoryLimit
wfMemoryLimit( $newLimit)
Raise PHP's memory limit (if needed).
Definition: GlobalFunctions.php:2771
$wgDBmwschema
$wgDBmwschema
Current wiki database schema name.
Definition: DefaultSettings.php:1903
$wgNamespaceProtection
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( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if( $wgGitInfoCacheDirectory===false && $wgCacheDirectory !==false) 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:247
$wgVirtualRestConfig
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:686
$wgGenerateThumbnailOnParse
$wgGenerateThumbnailOnParse
Allow thumbnail rendering on page view.
Definition: DefaultSettings.php:1318
$wgEnableUserEmail
$wgEnableUserEmail
Definition: Setup.php:428
NS_FILE
const NS_FILE
Definition: Defines.php:66
$wgExtensionAssetsPath
$wgExtensionAssetsPath
The URL path of the extensions directory.
Definition: DefaultSettings.php:222
MWExceptionHandler\installHandler
static installHandler()
Install handlers with PHP.
Definition: MWExceptionHandler.php:76
WebRequest\detectProtocol
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:274
$wgScopeTest
if(!defined( 'MEDIAWIKI')) $wgScopeTest
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
Definition: Setup.php:39
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2326
User\isValidUserName
static isValidUserName( $name)
Is the input a valid username?
Definition: User.php:917
$res
$res
Definition: testCompression.php:52
$wgCdnMaxAge
$wgCdnMaxAge
Cache TTL for the CDN sent as s-maxage (without ESI) or Surrogate-Control (with ESI).
Definition: DefaultSettings.php:2782
$wgSharedThumbnailScriptPath
string $wgSharedThumbnailScriptPath
Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:917
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:268
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:1007
$wgMetaNamespace
$wgMetaNamespace
Name of the project namespace.
Definition: DefaultSettings.php:3827
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:30
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:1933
$wgDBprefix
$wgDBprefix
Current wiki database table name prefix.
Definition: DefaultSettings.php:1913
$wgFetchCommonsDescriptions
bool $wgFetchCommonsDescriptions
Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:639
$wgStylePath
$wgStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:207
NamespaceInfo\$canonicalNames
static array $canonicalNames
Definitions of the NS_ constants are in Defines.php.
Definition: NamespaceInfo.php:62
$wgMemc
$wgMemc
Definition: Setup.php:791
$wgRepositoryBaseUrl
$wgRepositoryBaseUrl
Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:630
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:370
$wgMinUploadChunkSize
if(isset( $wgSysopEmailBans) && $wgSysopEmailBans===false) if( $wgMetaNamespace===false) $wgMinUploadChunkSize
Definition: Setup.php:457
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:565
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:106
$wgHashedUploadDirectory
$wgHashedUploadDirectory
Set this to false if you do not want MediaWiki to divide your images directory into many subdirectori...
Definition: DefaultSettings.php:932
wfParseUrl
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
Definition: GlobalFunctions.php:793
$wgHashedSharedUploadDirectory
bool $wgHashedSharedUploadDirectory
Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:622
$wgNoReplyAddress
$wgNoReplyAddress
Reply-To address for e-mail notifications.
Definition: DefaultSettings.php:1680
$wgEnotifMaxRecips
$wgEnotifMaxRecips
Definition: Setup.php:431
$wgEmergencyContact
$wgEmergencyContact
Site admin email address.
Definition: DefaultSettings.php:1663
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Definition: GlobalFunctions.php:1044
$wgFooterIcons
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
Definition: DefaultSettings.php:3485
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2345
$serverParts
if( $wgServer===false) foreach([ 'wgArticlePath', 'wgVariantArticlePath'] as $varName) if( $wgCanonicalServer===false) $serverParts
Definition: Setup.php:659
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:28
$wgDebugLogGroups
$wgDebugLogGroups
Map of string log group names to log destinations.
Definition: DefaultSettings.php:6249
$wgLang
$wgLang
Definition: Setup.php:881
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:483
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:26
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:435
$wgLoadScript
$wgLoadScript
The URL path to load.php.
Definition: DefaultSettings.php:193
MediaWiki
This class serves as a utility class for this extension.
$wgSharedPrefix
$wgSharedPrefix
Definition: DefaultSettings.php:2042
$wgLogTypes
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
Definition: DefaultSettings.php:7694
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:434
$wgEnableEmail
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
Definition: DefaultSettings.php:1687
GlobalVarConfig
Accesses configuration settings from $GLOBALS.
Definition: GlobalVarConfig.php:28
$wgSessionName
$wgSessionName
Override to customise the session name.
Definition: DefaultSettings.php:6071
MWDebug\setup
static setup()
Definition: MWDebug.php:73
$wgCdnServersNoPurge
$wgCdnServersNoPurge
As with $wgCdnServers, except these servers aren't purged on page changes; use to set a list of trust...
Definition: DefaultSettings.php:2842
$wgDebugLogFile
$wgDebugLogFile
Filename for debug logging.
Definition: DefaultSettings.php:6121
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:913
$wgCanonicalServer
$wgCanonicalServer
Canonical URL of the server, to use in IRC feeds and notification e-mails.
Definition: DefaultSettings.php:114
$wgSkipSkin
$wgSkipSkin
Definition: DefaultSettings.php:3337
$wgEnotifRevealEditorAddress
$wgEnotifRevealEditorAddress
Definition: Setup.php:433
$wgMemoryLimit
$wgMemoryLimit
The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit i...
Definition: DefaultSettings.php:2301
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:260
$wgUseSharedUploads
bool $wgUseSharedUploads
Shortcut for adding an entry to $wgForeignFileRepos.
Definition: DefaultSettings.php:595
$wgFullyInitialised
foreach( $wgExtensionFunctions as $func) if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition: Setup.php:932
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:8730
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:432
MediaWiki\Session\SessionManager\getGlobalSession
static getGlobalSession()
Get the "global" session.
Definition: SessionManager.php:106
$wgTitle
$wgTitle
Definition: Setup.php:899
$messageMemc
$messageMemc
Definition: Setup.php:792
$wgLocalTZoffset
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
Definition: DefaultSettings.php:3226
$wgNamespaceAliases
$wgNamespaceAliases['Image']
The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk".
Definition: Setup.php:254
$wgLocalInterwikis
$wgLocalInterwikis
Array for multiple $wgLocalInterwiki values, in case there are several interwiki prefixes that point ...
Definition: DefaultSettings.php:3935
$wgDeletedDirectory
$wgDeletedDirectory
What directory to place deleted uploads in.
Definition: DefaultSettings.php:437
$wgCacheSharedUploads
bool $wgCacheSharedUploads
Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:667
StubUserLang
Stub object for the user language.
Definition: StubUserLang.php:24
$wgServer
$wgServer
URL of the server.
Definition: DefaultSettings.php:105
$wgRCMaxAge
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
Definition: DefaultSettings.php:6801
$wgLanguageCode
$wgLanguageCode
Site language code.
Definition: DefaultSettings.php:2948
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:80
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:7169
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:199
$wgExtensionFunctions
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
Definition: DefaultSettings.php:7292
$wgEmailAuthentication
$wgEmailAuthentication
Definition: Setup.php:427
$wgUploadBaseUrl
$wgUploadBaseUrl
If set, this URL is added to the start of $wgUploadPath to form a complete upload URL.
Definition: DefaultSettings.php:359
$wgUploadDirectory
$wgUploadDirectory
The filesystem path of the images directory.
Definition: DefaultSettings.php:256
$wgAllowHTMLEmail
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
Definition: DefaultSettings.php:1779
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:431
$wgLogActionsHandlers
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
Definition: DefaultSettings.php:7806
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:2062
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:3688
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:438
$wgArticlePath
$wgArticlePath
Definition: img_auth.php:47
$self
$self
Definition: doMaintenance.php:55
wfGetMessageCacheStorage
wfGetMessageCacheStorage()
Get the cache object used by the message cache.
Definition: GlobalFunctions.php:2867
$wgCacheEpoch
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
Definition: DefaultSettings.php:2647
wfShorthandToInteger
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
Definition: GlobalFunctions.php:2817
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:2653
$debug
$debug
Definition: Setup.php:784
wfTempDir
wfTempDir()
Tries to get the system directory for temporary files.
Definition: GlobalFunctions.php:1947
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:6751
$wgSkipSkins
if( $wgSkipSkin) $wgSkipSkins[]
Definition: Setup.php:388
MediaWiki\Auth\AuthManager\singleton
static singleton()
Get the global AuthManager.
Definition: AuthManager.php:155
$wgThumbnailScriptPath
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
Definition: DefaultSettings.php:908
$wgContLanguageCode
foreach(LanguageCode::getNonstandardLanguageCodeMapping() as $code=> $bcp47) $wgContLanguageCode
Definition: Setup.php:499
Wikimedia\Rdbms\ChronologyProtector
Helper class for mitigating DB replication lag in order to provide "session consistency".
Definition: ChronologyProtector.php:39
FatalError
Exception class which takes an HTML error message, and does not produce a backtrace.
Definition: FatalError.php:28
$wgLocaltimezone
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Definition: DefaultSettings.php:3215
$wgEnotifImpersonal
$wgEnotifImpersonal
Definition: Setup.php:430
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition: LBFactory.php:40
$wgSharedUploadDBprefix
string $wgSharedUploadDBprefix
Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:658
$wgCookieSecure
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
Definition: DefaultSettings.php:6039
$wgShellLocale
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
Definition: DefaultSettings.php:8373
$cpPosInfo
$cpPosInfo
Definition: Setup.php:754
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:7755
$wgFileCacheDirectory
$wgFileCacheDirectory
Directory where the cached page will be saved.
Definition: DefaultSettings.php:262
$wgUploadPath
$wgUploadPath
The URL path for the images directory.
Definition: DefaultSettings.php:251
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:1065
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:68
$wgGroupPermissions
$wgGroupPermissions['sysop']['replacetext']
Definition: ReplaceText.php:56
$wgDBuser
$wgDBuser
Database username.
Definition: DefaultSettings.php:1928
$wgDBerrorLogTZ
$wgDBerrorLogTZ
Timezone to use in the error log.
Definition: DefaultSettings.php:2153
$wgPasswordPolicy
$wgPasswordPolicy
Password policy for the wiki.
Definition: DefaultSettings.php:4476
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:6159
$wgRequest
if(! $wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:752
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:272
$wgMinimalPasswordLength
$wgMinimalPasswordLength
Specifies the minimal length of a user password.
Definition: DefaultSettings.php:4686
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:664
NS_FILE_TALK
const NS_FILE_TALK
Definition: Defines.php:67
$wgOut
$wgOut
Definition: Setup.php:886
$wgPasswordSender
$wgPasswordSender
Sender email address for e-mail notifications.
Definition: DefaultSettings.php:1673
$wgPHPSessionHandling
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
Definition: DefaultSettings.php:2547
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3010
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:137
DBO_DEFAULT
const DBO_DEFAULT
Definition: defines.php:13
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
LanguageCode\getNonstandardLanguageCodeMapping
static getNonstandardLanguageCodeMapping()
Returns a mapping of non-standard language codes used by (current and previous version of) MediaWiki,...
Definition: LanguageCode.php:143
$wgContLang
$wgContLang
Definition: Setup.php:801
$wgForeignFileRepos
$wgForeignFileRepos
Enable the use of files from one or more other wikis.
Definition: DefaultSettings.php:554
$wgLocalStylePath
$wgLocalStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:215
$wgSecureLogin
$wgSecureLogin
This is to let user authenticate using https when they come from http.
Definition: DefaultSettings.php:4926
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:3864
$wgInitialSessionId
$wgInitialSessionId
Definition: Setup.php:810
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:7917
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2438
$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:491
$wgRightsUrl
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki.
Definition: DefaultSettings.php:7156
$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:156
$wgSharedUploadPath
string $wgSharedUploadPath
Shortcut for the 'url' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:613