MediaWiki  master
Setup.php
Go to the documentation of this file.
1 <?php
27 use Psr\Log\LoggerInterface;
30 
35 if ( !defined( 'MEDIAWIKI' ) ) {
36  exit( 1 );
37 }
38 
39 // Check to see if we are at the file scope
40 $wgScopeTest = 'MediaWiki Setup.php scope test';
41 if ( !isset( $GLOBALS['wgScopeTest'] ) || $GLOBALS['wgScopeTest'] !== $wgScopeTest ) {
42  echo "Error, Setup.php must be included from the file scope.\n";
43  die( 1 );
44 }
45 unset( $wgScopeTest );
46 
51 // Sanity check (T5782, T122807)
52 if ( ini_get( 'mbstring.func_overload' ) ) {
53  die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
54 }
55 
56 // Define MW_ENTRY_POINT if it's not already, so that config code can check the
57 // value without using defined()
58 if ( !defined( 'MW_ENTRY_POINT' ) ) {
64  define( 'MW_ENTRY_POINT', 'unknown' );
65 }
66 
67 // Start the autoloader, so that extensions can derive classes from core files
68 require_once "$IP/includes/AutoLoader.php";
69 
70 // Load global constants
71 require_once "$IP/includes/Defines.php";
72 
73 // Load default settings
74 require_once "$IP/includes/DefaultSettings.php";
75 
76 // Load global functions
77 require_once "$IP/includes/GlobalFunctions.php";
78 
79 // Load composer's autoloader if present
80 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
81  require_once "$IP/vendor/autoload.php";
82 } elseif ( file_exists( "$IP/vendor/autoload.php" ) ) {
83  die( "$IP/vendor/autoload.php exists but is not readable" );
84 }
85 
86 // Assert that composer dependencies were successfully loaded
87 if ( !interface_exists( LoggerInterface::class ) ) {
88  $message = (
89  'MediaWiki requires the <a href="https://github.com/php-fig/log">PSR-3 logging ' .
90  "library</a> to be present. This library is not embedded directly in MediaWiki's " .
91  "git repository and must be installed separately by the end user.\n\n" .
92  'Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git' .
93  '#Fetch_external_libraries">mediawiki.org</a> for help on installing ' .
94  'the required components.'
95  );
96  echo $message;
97  trigger_error( $message, E_USER_ERROR );
98  die( 1 );
99 }
100 
105 // Install a header callback
107 
108 // Set the encoding used by PHP for reading HTTP input, and writing output.
109 // This is also the default for mbstring functions.
110 mb_internal_encoding( 'UTF-8' );
111 
116 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
117  call_user_func( MW_CONFIG_CALLBACK );
118 } else {
119  if ( !defined( 'MW_CONFIG_FILE' ) ) {
120  define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
121  }
122  require_once MW_CONFIG_FILE;
123 }
124 
132 if ( defined( 'MW_SETUP_CALLBACK' ) ) {
133  call_user_func( MW_SETUP_CALLBACK );
134 }
135 
140 // Load queued extensions
141 ExtensionRegistry::getInstance()->loadFromQueue();
142 // Don't let any other extensions load
144 
145 // Set the configured locale on all requests for consisteny
146 putenv( "LC_ALL=$wgShellLocale" );
147 setlocale( LC_ALL, $wgShellLocale );
148 
149 // Set various default paths sensibly...
150 if ( $wgScript === false ) {
151  $wgScript = "$wgScriptPath/index.php";
152 }
153 if ( $wgLoadScript === false ) {
154  $wgLoadScript = "$wgScriptPath/load.php";
155 }
156 if ( $wgRestPath === false ) {
157  $wgRestPath = "$wgScriptPath/rest.php";
158 }
159 
160 if ( $wgArticlePath === false ) {
161  if ( $wgUsePathInfo ) {
162  $wgArticlePath = "$wgScript/$1";
163  } else {
164  $wgArticlePath = "$wgScript?title=$1";
165  }
166 }
167 
168 if ( $wgResourceBasePath === null ) {
170 }
171 if ( $wgStylePath === false ) {
172  $wgStylePath = "$wgResourceBasePath/skins";
173 }
174 if ( $wgLocalStylePath === false ) {
175  // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
176  $wgLocalStylePath = "$wgScriptPath/skins";
177 }
178 if ( $wgExtensionAssetsPath === false ) {
179  $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
180 }
181 
182 if ( $wgLogo === false ) {
183  $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
184 }
185 
186 if ( $wgUploadPath === false ) {
187  $wgUploadPath = "$wgScriptPath/images";
188 }
189 if ( $wgUploadDirectory === false ) {
190  $wgUploadDirectory = "$IP/images";
191 }
192 if ( $wgReadOnlyFile === false ) {
193  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
194 }
195 if ( $wgFileCacheDirectory === false ) {
196  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
197 }
198 if ( $wgDeletedDirectory === false ) {
199  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
200 }
201 
202 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
203  $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
204 }
205 
206 // Fix path to icon images after they were moved in 1.24
207 if ( $wgRightsIcon ) {
208  $wgRightsIcon = str_replace(
209  "{$wgStylePath}/common/images/",
210  "{$wgResourceBasePath}/resources/assets/licenses/",
212  );
213 }
214 
215 if ( isset( $wgFooterIcons['copyright']['copyright'] )
216  && $wgFooterIcons['copyright']['copyright'] === []
217 ) {
218  if ( $wgRightsIcon || $wgRightsText ) {
219  $wgFooterIcons['copyright']['copyright'] = [
220  'url' => $wgRightsUrl,
221  'src' => $wgRightsIcon,
222  'alt' => $wgRightsText,
223  ];
224  }
225 }
226 
227 if ( isset( $wgFooterIcons['poweredby'] )
228  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
229  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
230 ) {
231  $wgFooterIcons['poweredby']['mediawiki']['src'] =
232  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
233  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
234  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
235  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
236 }
237 
246 
254 
259  'name' => 'fsLockManager',
260  'class' => FSLockManager::class,
261  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
262 ];
263 $wgLockManagers[] = [
264  'name' => 'nullLockManager',
265  'class' => NullLockManager::class,
266 ];
267 
273  'imagesPerRow' => 0,
274  'imageWidth' => 120,
275  'imageHeight' => 120,
276  'captionLength' => true,
277  'showBytes' => true,
278  'showDimensions' => true,
279  'mode' => 'traditional',
280 ];
281 
285 if ( !$wgLocalFileRepo ) {
286  $wgLocalFileRepo = [
287  'class' => LocalRepo::class,
288  'name' => 'local',
289  'directory' => $wgUploadDirectory,
290  'scriptDirUrl' => $wgScriptPath,
292  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
293  'thumbScriptUrl' => $wgThumbnailScriptPath,
294  'transformVia404' => !$wgGenerateThumbnailOnParse,
295  'deletedDir' => $wgDeletedDirectory,
296  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0
297  ];
298 }
299 
300 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
301  // Create a default FileBackend name.
302  // FileBackendGroup will register a default, if absent from $wgFileBackends.
303  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
304 }
305 
309 if ( $wgUseSharedUploads ) {
310  if ( $wgSharedUploadDBname ) {
311  $wgForeignFileRepos[] = [
312  'class' => ForeignDBRepo::class,
313  'name' => 'shared',
314  'directory' => $wgSharedUploadDirectory,
315  'url' => $wgSharedUploadPath,
316  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
317  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
318  'transformVia404' => !$wgGenerateThumbnailOnParse,
319  'dbType' => $wgDBtype,
320  'dbServer' => $wgDBserver,
321  'dbUser' => $wgDBuser,
322  'dbPassword' => $wgDBpassword,
323  'dbName' => $wgSharedUploadDBname,
324  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
325  'tablePrefix' => $wgSharedUploadDBprefix,
326  'hasSharedCache' => $wgCacheSharedUploads,
327  'descBaseUrl' => $wgRepositoryBaseUrl,
328  'fetchDescription' => $wgFetchCommonsDescriptions,
329  ];
330  } else {
331  $wgForeignFileRepos[] = [
332  'class' => FileRepo::class,
333  'name' => 'shared',
334  'directory' => $wgSharedUploadDirectory,
335  'url' => $wgSharedUploadPath,
336  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
337  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
338  'transformVia404' => !$wgGenerateThumbnailOnParse,
339  'descBaseUrl' => $wgRepositoryBaseUrl,
340  'fetchDescription' => $wgFetchCommonsDescriptions,
341  ];
342  }
343 }
344 if ( $wgUseInstantCommons ) {
345  $wgForeignFileRepos[] = [
346  'class' => ForeignAPIRepo::class,
347  'name' => 'wikimediacommons',
348  'apibase' => 'https://commons.wikimedia.org/w/api.php',
349  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
350  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
351  'hashLevels' => 2,
352  'transformVia404' => true,
353  'fetchDescription' => true,
354  'descriptionCacheExpiry' => 43200,
355  'apiThumbCacheExpiry' => 0,
356  ];
357 }
358 foreach ( $wgForeignFileRepos as &$repo ) {
359  if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
360  $repo['directory'] = $wgUploadDirectory; // b/c
361  }
362  if ( !isset( $repo['backend'] ) ) {
363  $repo['backend'] = $repo['name'] . '-backend';
364  }
365 }
366 unset( $repo ); // no global pollution; destroy reference
367 
368 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
369 // Ensure that default user options are not invalid, since that breaks Special:Preferences
370 $wgDefaultUserOptions['rcdays'] = min(
371  $wgDefaultUserOptions['rcdays'],
372  ceil( $rcMaxAgeDays )
373 );
374 $wgDefaultUserOptions['watchlistdays'] = min(
375  $wgDefaultUserOptions['watchlistdays'],
376  ceil( $rcMaxAgeDays )
377 );
378 unset( $rcMaxAgeDays );
379 
380 $wgSkipSkins[] = 'fallback';
381 $wgSkipSkins[] = 'apioutput';
382 
383 if ( $wgLocalInterwiki ) {
384  // Hard deprecated in 1.34.
385  wfDeprecated( '$wgLocalInterwiki – use $wgLocalInterwikis instead', '1.23' );
386  array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
387 }
388 
389 // Set default shared prefix
390 if ( $wgSharedPrefix === false ) {
392 }
393 
394 // Set default shared schema
395 if ( $wgSharedSchema === false ) {
397 }
398 
399 if ( !$wgCookiePrefix ) {
400  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
402  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
404  } elseif ( $wgDBprefix ) {
406  } else {
408  }
409 }
410 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
411 
412 if ( $wgEnableEmail ) {
414 } else {
415  // Disable all other email settings automatically if $wgEnableEmail
416  // is set to false. - T65678
417  $wgAllowHTMLEmail = false;
418  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
428  unset( $wgGroupPermissions['user']['sendemail'] );
429  $wgUseEnotif = false;
432 }
433 
434 if ( $wgMetaNamespace === false ) {
435  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
436 }
437 
438 // Ensure the minimum chunk size is less than PHP upload limits or the maximum
439 // upload size.
442  UploadBase::getMaxUploadSize( 'file' ),
443  UploadBase::getMaxPhpUploadSize(),
445  ini_get( 'post_max_size' ),
446  PHP_INT_MAX
447  ) ?: PHP_INT_MAX ) - 1024 // Leave some room for other POST parameters
448 );
449 
455 
457 if ( is_array( $wgExtraNamespaces ) ) {
459 }
460 
461 // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php
462 if ( count( $wgDummyLanguageCodes ) !== 0 ) {
463  wfDeprecated( '$wgDummyLanguageCodes', '1.29' );
464 }
465 // Merge in the legacy language codes, incorporating overrides from the config
467  // Internal language codes of the private-use area which get mapped to
468  // themselves.
469  'qqq' => 'qqq', // Used for message documentation
470  'qqx' => 'qqx', // Used for viewing message keys
472 // Merge in (inverted) BCP 47 mappings
473 foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) {
474  $bcp47 = strtolower( $bcp47 ); // force case-insensitivity
475  if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) {
476  $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code;
477  }
478 }
479 
480 // These are now the same, always
481 // To determine the user language, use $wgLang->getCode()
483 
484 // Temporary backwards-compatibility reading of old Squid-named CDN settings as of MediaWiki 1.34,
485 // to support sysadmins who fail to update their settings immediately:
486 
487 if ( isset( $wgUseSquid ) ) {
488  // If the sysadmin is still setting a value of $wgUseSquid to true but $wgUseCdn is the default of
489  // false, to be safe, assume they do want this still, so enable it.
490  if ( !$wgUseCdn && $wgUseSquid ) {
491  $wgUseCdn = $wgUseSquid;
492  wfDeprecated( '$wgUseSquid enabled but $wgUseCdn disabled; enabling CDN functions', '1.34' );
493  }
494 } else {
495  // Backwards-compatibility for extensions that read this value.
496  $wgUseSquid = $wgUseCdn;
497 }
498 
499 if ( isset( $wgSquidServers ) ) {
500  // If the sysadmin is still setting a value of $wgSquidServers but $wgCdnServers is the default of
501  // empty, to be safe, assume they do want these servers to be still used, so use them.
502  if ( !empty( $wgSquidServers ) && empty( $wgCdnServers ) ) {
503  $wgCdnServers = $wgSquidServers;
504  wfDeprecated( '$wgSquidServers set, $wgCdnServers empty; using them', '1.34' );
505  }
506 } else {
507  // Backwards-compatibility for extensions that read this value.
508  $wgSquidServers = $wgCdnServers;
509 }
510 
511 if ( isset( $wgSquidServersNoPurge ) ) {
512  // If the sysadmin is still setting values in $wgSquidServersNoPurge but $wgCdnServersNoPurge is
513  // the default of empty, to be safe, assume they do want these servers to be still used, so use
514  // them.
515  if ( !empty( $wgSquidServersNoPurge ) && empty( $wgCdnServersNoPurge ) ) {
516  $wgCdnServersNoPurge = $wgSquidServersNoPurge;
517  wfDeprecated( '$wgSquidServersNoPurge set, $wgCdnServersNoPurge empty; using them', '1.34' );
518  }
519 } else {
520  // Backwards-compatibility for extensions that read this value.
521  $wgSquidServersNoPurge = $wgCdnServersNoPurge;
522 }
523 
524 if ( isset( $wgSquidMaxage ) ) {
525  // If the sysadmin is still setting a value of $wgSquidMaxage and it's higher than $wgCdnMaxAge,
526  // to be safe, assume they want the higher (lower performance requirement) value, so use that.
527  if ( $wgCdnMaxAge < $wgSquidMaxage ) {
528  $wgCdnMaxAge = $wgSquidMaxage;
529  wfDeprecated( '$wgSquidMaxage set higher than $wgCdnMaxAge; using the higher value', '1.34' );
530  }
531 } else {
532  // Backwards-compatibility for extensions that read this value.
533  $wgSquidMaxage = $wgCdnMaxAge;
534 }
535 
536 // Blacklisted file extensions shouldn't appear on the "allowed" list
537 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
538 
540  Wikimedia\suppressWarnings();
541  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
542  Wikimedia\restoreWarnings();
543 }
544 
545 if ( $wgNewUserLog ) {
546  // Add new user log type
547  $wgLogTypes[] = 'newusers';
548  $wgLogNames['newusers'] = 'newuserlogpage';
549  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
550  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
551  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
552  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
553  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
554  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
555 }
556 
557 if ( $wgPageCreationLog ) {
558  // Add page creation log type
559  $wgLogTypes[] = 'create';
560  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
561 }
562 
563 if ( $wgPageLanguageUseDB ) {
564  $wgLogTypes[] = 'pagelang';
565  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
566 }
567 
568 if ( $wgCookieSecure === 'detect' ) {
569  $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
570 }
571 
572 // Backwards compatibility with old password limits
573 if ( $wgMinimalPasswordLength !== false ) {
574  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
575 }
576 
577 if ( $wgMaximalPasswordLength !== false ) {
578  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
579 }
580 
581 if ( $wgPHPSessionHandling !== 'enable' &&
582  $wgPHPSessionHandling !== 'warn' &&
583  $wgPHPSessionHandling !== 'disable'
584 ) {
585  $wgPHPSessionHandling = 'warn';
586 }
587 if ( defined( 'MW_NO_SESSION' ) ) {
588  // If the entry point wants no session, force 'disable' here unless they
589  // specifically set it to the (undocumented) 'warn'.
590  // @phan-suppress-next-line PhanUndeclaredConstant
591  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
592 }
593 
595 
596 // Reset the global service locator, so any services that have already been created will be
597 // re-created while taking into account any custom settings and extensions.
598 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
599 
600 // Define a constant that indicates that the bootstrapping of the service locator
601 // is complete.
602 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
603 
605 
606 // T30798: $wgServer must be explicitly set
607 if ( $wgServer === false ) {
608  throw new FatalError(
609  '$wgServer must be set in LocalSettings.php. ' .
610  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
611  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
612  );
613 }
614 
615 if ( $wgCanonicalServer === false ) {
617 }
618 
619 // Set server name
621 if ( $wgServerName !== false ) {
622  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
623  . 'not customized. Overwriting $wgServerName.' );
624 }
626 unset( $serverParts );
627 
628 // Set defaults for configuration variables
629 // that are derived from the server name by default
630 // Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
631 if ( !$wgEmergencyContact ) {
632  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
633 }
634 if ( !$wgPasswordSender ) {
635  $wgPasswordSender = 'apache@' . $wgServerName;
636 }
637 if ( !$wgNoReplyAddress ) {
639 }
640 
641 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
642  $wgSecureLogin = false;
643  wfWarn( 'Secure login was enabled on a server that only supports '
644  . 'HTTP or HTTPS. Disabling secure login.' );
645 }
646 
648 
649 // Now that GlobalFunctions is loaded, set defaults that depend on it.
650 if ( $wgTmpDirectory === false ) {
652 }
653 
654 // We don't use counters anymore. Left here for extensions still
655 // expecting this to exist. Should be removed sometime 1.26 or later.
656 if ( !isset( $wgDisableCounters ) ) {
657  $wgDisableCounters = true;
658 }
659 
660 if ( $wgMainWANCache === false ) {
661  // Setup a WAN cache from $wgMainCacheType with no relayer.
662  // Sites using multiple datacenters can configure a relayer.
663  $wgMainWANCache = 'mediawiki-main-default';
665  'class' => WANObjectCache::class,
666  'cacheId' => $wgMainCacheType
667  ];
668 }
669 
670 if ( $wgSharedDB && $wgSharedTables ) {
671  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
672  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
673  array_fill_keys(
675  [
676  'dbname' => $wgSharedDB,
677  'schema' => $wgSharedSchema,
678  'prefix' => $wgSharedPrefix
679  ]
680  )
681  );
682 }
683 
684 // Raise the memory limit if it's too low
685 // Note, this makes use of wfDebug, and thus should not be before
686 // MWDebug::init() is called.
688 
694 if ( $wgLocaltimezone === null ) {
695  Wikimedia\suppressWarnings();
696  $wgLocaltimezone = date_default_timezone_get();
697  Wikimedia\restoreWarnings();
698 }
699 
700 date_default_timezone_set( $wgLocaltimezone );
701 if ( $wgLocalTZoffset === null ) {
702  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
703 }
704 // The part after the System| is ignored, but rest of MW fills it
705 // out as the local offset.
706 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
707 
708 if ( !$wgDBerrorLogTZ ) {
710 }
711 
712 // Initialize the request object in $wgRequest
713 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
714 // Set user IP/agent information for agent session consistency purposes
715 $cpPosInfo = LBFactory::getCPInfoFromCookieValue(
716  // The cookie has no prefix and is set by MediaWiki::preOutputCommit()
717  $wgRequest->getCookie( 'cpPosIndex', '' ),
718  // Mitigate broken client-side cookie expiration handling (T190082)
719  time() - ChronologyProtector::POSITION_COOKIE_TTL
720 );
721 MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
722  'IPAddress' => $wgRequest->getIP(),
723  'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
724  'ChronologyProtection' => $wgRequest->getHeader( 'MediaWiki-Chronology-Protection' ),
725  'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ),
726  'ChronologyClientId' => $cpPosInfo['clientId']
727  ?? $wgRequest->getHeader( 'MediaWiki-Chronology-Client-Id' )
728 ] );
729 unset( $cpPosInfo );
730 // Make sure that object caching does not undermine the ChronologyProtector improvements
731 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
732  // The user is pinned to the primary DC, meaning that they made recent changes which should
733  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
734  // they use a blind TTL and could be stale if an object changes twice in a short time span.
735  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
736 }
737 
738 // Useful debug output
739 if ( $wgCommandLineMode ) {
740  if ( isset( $self ) ) {
741  wfDebug( "\n\nStart command line script $self\n" );
742  }
743 } else {
744  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
745  $debug .= "HTTP HEADERS:\n";
746  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
747  $debug .= "$name: $value\n";
748  }
749  wfDebug( $debug );
750 }
751 
754 
755 // Most of the config is out, some might want to run hooks here.
756 Hooks::run( 'SetupAfterCache' );
757 
762 $wgContLang = MediaWikiServices::getInstance()->getContentLanguage();
763 
764 // Now that variant lists may be available...
765 $wgRequest->interpolateTitle();
766 
772 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
773  // If session.auto_start is there, we can't touch session name
774  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
775  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
776  }
777 
778  // Create the SessionManager singleton and set up our session handler,
779  // unless we're specifically asked not to.
780  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
782  MediaWiki\Session\SessionManager::singleton()
783  );
784  }
785 
786  // Initialize the session
787  try {
789  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
790  // The exception is because the request had multiple possible
791  // sessions tied for top priority. Report this to the user.
792  $list = [];
793  foreach ( $ex->getSessionInfos() as $info ) {
794  $list[] = $info->getProvider()->describe( $wgContLang );
795  }
796  $list = $wgContLang->listToText( $list );
797  throw new HttpError( 400,
798  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
799  );
800  }
801 
802  if ( $session->isPersistent() ) {
803  $wgInitialSessionId = $session->getSessionId();
804  }
805 
806  $session->renew();
807  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
808  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
809  session_id() !== $session->getId()
810  ) {
811  // Start the PHP-session for backwards compatibility
812  if ( session_id() !== '' ) {
813  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
814  'old_id' => session_id(),
815  'new_id' => $session->getId(),
816  ] );
817  session_write_close();
818  }
819  session_id( $session->getId() );
820  session_start();
821  }
822 
823  unset( $session );
824 } else {
825  // Even if we didn't set up a global Session, still install our session
826  // handler unless specifically requested not to.
827  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
829  MediaWiki\Session\SessionManager::singleton()
830  );
831  }
832 }
833 
837 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
838 
843 
847 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
848 
853 $wgParser = new StubObject( 'wgParser', function () {
854  return MediaWikiServices::getInstance()->getParser();
855 } );
856 
860 $wgTitle = null;
861 
862 // Extension setup functions
863 // Entries should be added to this variable during the inclusion
864 // of the extension file. This allows the extension to perform
865 // any necessary initialisation in the fully initialised environment
866 foreach ( $wgExtensionFunctions as $func ) {
867  call_user_func( $func );
868 }
869 
870 // If the session user has a 0 id but a valid name, that means we need to
871 // autocreate it.
872 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
873  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
874  if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
875  $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
876  $sessionUser,
877  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
878  true
879  );
880  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
881  'event' => 'autocreate',
882  'status' => $res,
883  ] );
884  unset( $res );
885  }
886  unset( $sessionUser );
887 }
888 
889 if ( !$wgCommandLineMode ) {
891 }
892 
$wgCanonicalNamespaceNames
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:454
$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:3924
LanguageCode\getDeprecatedCodeMapping
static getDeprecatedCodeMapping()
Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up...
Definition: LanguageCode.php:125
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:2743
$wgUsersNotifiedOnAllChanges
$wgUsersNotifiedOnAllChanges
Definition: Setup.php:431
$wgMaximalPasswordLength
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
Definition: DefaultSettings.php:4706
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:267
$serverParts
if( $wgServer===false) if( $wgCanonicalServer===false) $serverParts
Definition: Setup.php:620
$wgCdnServers
$wgCdnServers
List of proxy servers to purge on changes; default port is 80.
Definition: DefaultSettings.php:2833
$wgCookiePrefix
if( $wgLocalInterwiki) if( $wgSharedPrefix===false) if( $wgSharedSchema===false) if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:410
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:7905
$wgParser
$wgParser
Definition: Setup.php:853
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:420
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:2701
$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:272
$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:7146
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:1893
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:370
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:427
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2047
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:130
$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:537
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:7760
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:430
$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:2449
$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:2759
$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:245
$wgVirtualRestConfig
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:647
$wgGenerateThumbnailOnParse
$wgGenerateThumbnailOnParse
Allow thumbnail rendering on page view.
Definition: DefaultSettings.php:1318
$wgEnableUserEmail
$wgEnableUserEmail
Definition: Setup.php:419
NamespaceInfo\CANONICAL_NAMES
const CANONICAL_NAMES
Definitions of the NS_ constants are in Defines.php.
Definition: NamespaceInfo.php:59
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:63
WebRequest\detectProtocol
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:281
$wgScopeTest
if(!defined( 'MEDIAWIKI')) $wgScopeTest
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
Definition: Setup.php:40
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2321
User\isValidUserName
static isValidUserName( $name)
Is the input a valid username?
Definition: User.php:974
$res
$res
Definition: testCompression.php:54
$wgCdnMaxAge
$wgCdnMaxAge
Cache TTL for the CDN sent as s-maxage (without ESI) or Surrogate-Control (with ESI).
Definition: DefaultSettings.php:2774
$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:3826
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
$wgMemc
$wgMemc
Definition: Setup.php:752
$wgRepositoryBaseUrl
$wgRepositoryBaseUrl
Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:630
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:368
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:565
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:127
$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:422
$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:3490
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2340
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:28
$wgLang
$wgLang
Definition: Setup.php:842
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:466
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:26
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:426
$wgLoadScript
$wgLoadScript
The URL path to load.php.
Definition: DefaultSettings.php:193
MediaWiki
A helper class for throttling authentication attempts.
$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:7676
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:425
$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:6072
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:2843
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
$wgMinUploadChunkSize
if( $wgMetaNamespace===false) $wgMinUploadChunkSize
Definition: Setup.php:440
$wgEnotifRevealEditorAddress
$wgEnotifRevealEditorAddress
Definition: Setup.php:424
$wgMemoryLimit
$wgMemoryLimit
The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit i...
Definition: DefaultSettings.php:2296
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:258
$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:893
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:8697
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:423
MediaWiki\Session\SessionManager\getGlobalSession
static getGlobalSession()
Get the "global" session.
Definition: SessionManager.php:106
$wgTitle
$wgTitle
Definition: Setup.php:860
$messageMemc
$messageMemc
Definition: Setup.php:753
$wgLocalTZoffset
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
Definition: DefaultSettings.php:3236
$wgNamespaceAliases
$wgNamespaceAliases['Image']
The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk".
Definition: Setup.php:252
$wgLocalInterwikis
$wgLocalInterwikis
Array for multiple $wgLocalInterwiki values, in case there are several interwiki prefixes that point ...
Definition: DefaultSettings.php:3934
$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:6783
$wgLanguageCode
$wgLanguageCode
Site language code.
Definition: DefaultSettings.php:2949
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:80
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:7151
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:7274
$wgEmailAuthentication
$wgEmailAuthentication
Definition: Setup.php:418
$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:447
$wgLogActionsHandlers
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
Definition: DefaultSettings.php:7788
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:2064
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:3693
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:429
$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:2855
$wgCacheEpoch
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
Definition: DefaultSettings.php:2639
wfShorthandToInteger
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
Definition: GlobalFunctions.php:2805
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:2645
$debug
$debug
Definition: Setup.php:745
wfTempDir
wfTempDir()
Tries to get the system directory for temporary files.
Definition: GlobalFunctions.php:1949
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:6733
$wgSkipSkins
$wgSkipSkins[]
Definition: Setup.php:380
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
$wgGroupPermissions
$wgGroupPermissions
Permission keys given to users in each group.
Definition: DefaultSettings.php:5116
$wgContLanguageCode
foreach(LanguageCode::getNonstandardLanguageCodeMapping() as $code=> $bcp47) $wgContLanguageCode
Definition: Setup.php:482
Wikimedia\Rdbms\ChronologyProtector
Helper class for mitigating DB replication lag in order to provide "session consistency".
Definition: ChronologyProtector.php:39
FatalError
Abort the web request with a custom HTML string that will represent the entire response.
Definition: FatalError.php:35
$wgLocaltimezone
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Definition: DefaultSettings.php:3225
$wgEnotifImpersonal
$wgEnotifImpersonal
Definition: Setup.php:421
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:6040
$wgShellLocale
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
Definition: DefaultSettings.php:8355
$cpPosInfo
$cpPosInfo
Definition: Setup.php:715
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:7737
$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
$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:4477
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:6160
$wgRequest
if(! $wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:713
Pingback\schedulePingback
static schedulePingback()
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send...
Definition: Pingback.php:273
$wgMinimalPasswordLength
$wgMinimalPasswordLength
Specifies the minimal length of a user password.
Definition: DefaultSettings.php:4693
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:625
NS_FILE_TALK
const NS_FILE_TALK
Definition: Defines.php:67
$wgOut
$wgOut
Definition: Setup.php:847
$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:2539
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3020
$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:141
$wgContLang
$wgContLang
Definition: Setup.php:762
$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:4934
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:3863
$wgInitialSessionId
$wgInitialSessionId
Definition: Setup.php:771
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:7899
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2433
$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:7138
$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