MediaWiki  master
Setup.php
Go to the documentation of this file.
1 <?php
38 use Psr\Log\LoggerInterface;
41 
49 // This file must be included from a valid entry point (e.g. WebStart.php, Maintenance.php)
50 if ( !defined( 'MEDIAWIKI' ) ) {
51  exit( 1 );
52 }
53 
54 // This file must have global scope.
55 $wgScopeTest = 'MediaWiki Setup.php scope test';
56 if ( !isset( $GLOBALS['wgScopeTest'] ) || $GLOBALS['wgScopeTest'] !== $wgScopeTest ) {
57  echo "Error, Setup.php must be included from the file scope.\n";
58  die( 1 );
59 }
60 unset( $wgScopeTest );
61 
62 // PHP must not be configured to overload mbstring functions. (T5782, T122807)
63 // This was deprecated by upstream in PHP 7.2, likely to be removed in PHP 8.0.
64 if ( ini_get( 'mbstring.func_overload' ) ) {
65  die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
66 }
67 
68 // The MW_ENTRY_POINT constant must always exists, to make it safe to access.
69 // For compat, we do support older and custom MW entryoints that don't set this,
70 // in which case we assign a default here.
71 if ( !defined( 'MW_ENTRY_POINT' ) ) {
77  define( 'MW_ENTRY_POINT', 'unknown' );
78 }
79 
86 require_once "$IP/includes/AutoLoader.php";
87 require_once "$IP/includes/Defines.php";
88 require_once "$IP/includes/DefaultSettings.php";
89 require_once "$IP/includes/GlobalFunctions.php";
90 
91 // Load composer's autoloader if present
92 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
93  require_once "$IP/vendor/autoload.php";
94 } elseif ( file_exists( "$IP/vendor/autoload.php" ) ) {
95  die( "$IP/vendor/autoload.php exists but is not readable" );
96 }
97 
98 // Assert that composer dependencies were successfully loaded
99 if ( !interface_exists( LoggerInterface::class ) ) {
100  $message = (
101  'MediaWiki requires the <a href="https://github.com/php-fig/log">PSR-3 logging ' .
102  "library</a> to be present. This library is not embedded directly in MediaWiki's " .
103  "git repository and must be installed separately by the end user.\n\n" .
104  'Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git' .
105  '#Fetch_external_libraries">mediawiki.org</a> for help on installing ' .
106  'the required components.'
107  );
108  echo $message;
109  trigger_error( $message, E_USER_ERROR );
110  die( 1 );
111 }
112 
114 
115 // Set the encoding used by PHP for reading HTTP input, and writing output.
116 // This is also the default for mbstring functions.
117 mb_internal_encoding( 'UTF-8' );
118 
123 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
124  call_user_func( MW_CONFIG_CALLBACK );
125 } else {
126  if ( !defined( 'MW_CONFIG_FILE' ) ) {
127  define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
128  }
129  require_once MW_CONFIG_FILE;
130 }
131 
139 if ( defined( 'MW_SETUP_CALLBACK' ) ) {
140  call_user_func( MW_SETUP_CALLBACK );
141 }
142 
147 ExtensionRegistry::getInstance()->loadFromQueue();
148 // Don't let any other extensions load
150 
151 // Set the configured locale on all requests for consistency
152 // This must be after LocalSettings.php (and is informed by the installer).
153 putenv( "LC_ALL=$wgShellLocale" );
154 setlocale( LC_ALL, $wgShellLocale );
155 
160 if ( $wgScript === false ) {
161  $wgScript = "$wgScriptPath/index.php";
162 }
163 if ( $wgLoadScript === false ) {
164  $wgLoadScript = "$wgScriptPath/load.php";
165 }
166 if ( $wgRestPath === false ) {
167  $wgRestPath = "$wgScriptPath/rest.php";
168 }
169 if ( $wgArticlePath === false ) {
170  if ( $wgUsePathInfo ) {
171  $wgArticlePath = "$wgScript/$1";
172  } else {
173  $wgArticlePath = "$wgScript?title=$1";
174  }
175 }
176 if ( $wgResourceBasePath === null ) {
178 }
179 if ( $wgStylePath === false ) {
180  $wgStylePath = "$wgResourceBasePath/skins";
181 }
182 if ( $wgLocalStylePath === false ) {
183  // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
184  $wgLocalStylePath = "$wgScriptPath/skins";
185 }
186 if ( $wgExtensionAssetsPath === false ) {
187  $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
188 }
189 
190 // For backwards compatibility, the value of wgLogos is copied to wgLogo.
191 // This is because some extensions/skins may be using $config->get('Logo')
192 // to access the value.
193 if ( $wgLogos !== false && isset( $wgLogos['1x'] ) ) {
194  $wgLogo = $wgLogos['1x'];
195 }
196 if ( $wgLogo === false ) {
197  $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
198 }
199 
200 if ( $wgUploadPath === false ) {
201  $wgUploadPath = "$wgScriptPath/images";
202 }
203 if ( $wgUploadDirectory === false ) {
204  $wgUploadDirectory = "$IP/images";
205 }
206 if ( $wgReadOnlyFile === false ) {
207  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
208 }
209 if ( $wgFileCacheDirectory === false ) {
210  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
211 }
212 if ( $wgDeletedDirectory === false ) {
213  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
214 }
215 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
216  $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
217 }
218 if ( $wgSharedPrefix === false ) {
220 }
221 if ( $wgSharedSchema === false ) {
223 }
224 if ( $wgMetaNamespace === false ) {
225  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
226 }
227 
228 // Blacklisted file extensions shouldn't appear on the "allowed" list
229 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
230 
231 // Fix path to icon images after they were moved in 1.24
232 if ( $wgRightsIcon ) {
233  $wgRightsIcon = str_replace(
234  "{$wgStylePath}/common/images/",
235  "{$wgResourceBasePath}/resources/assets/licenses/",
237  );
238 }
239 
240 if ( isset( $wgFooterIcons['copyright']['copyright'] )
241  && $wgFooterIcons['copyright']['copyright'] === []
242 ) {
243  if ( $wgRightsIcon || $wgRightsText ) {
244  $wgFooterIcons['copyright']['copyright'] = [
245  'url' => $wgRightsUrl,
246  'src' => $wgRightsIcon,
247  'alt' => $wgRightsText,
248  ];
249  }
250 }
251 
252 if ( isset( $wgFooterIcons['poweredby'] )
253  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
254  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
255 ) {
256  $wgFooterIcons['poweredby']['mediawiki']['src'] =
257  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
258  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
259  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
260  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
261 }
262 
271 
276  'name' => 'fsLockManager',
277  'class' => FSLockManager::class,
278  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
279 ];
280 $wgLockManagers[] = [
281  'name' => 'nullLockManager',
282  'class' => NullLockManager::class,
283 ];
284 
290  'imagesPerRow' => 0,
291  'imageWidth' => 120,
292  'imageHeight' => 120,
293  'captionLength' => true,
294  'showBytes' => true,
295  'showDimensions' => true,
296  'mode' => 'traditional',
297 ];
298 
302 if ( !$wgLocalFileRepo ) {
303  $wgLocalFileRepo = [
304  'class' => LocalRepo::class,
305  'name' => 'local',
306  'directory' => $wgUploadDirectory,
307  'scriptDirUrl' => $wgScriptPath,
309  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
310  'thumbScriptUrl' => $wgThumbnailScriptPath,
311  'transformVia404' => !$wgGenerateThumbnailOnParse,
312  'deletedDir' => $wgDeletedDirectory,
313  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0
314  ];
315 }
316 
317 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
318  // Create a default FileBackend name.
319  // FileBackendGroup will register a default, if absent from $wgFileBackends.
320  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
321 }
322 
326 if ( $wgUseSharedUploads ) {
327  if ( $wgSharedUploadDBname ) {
328  $wgForeignFileRepos[] = [
329  'class' => ForeignDBRepo::class,
330  'name' => 'shared',
331  'directory' => $wgSharedUploadDirectory,
332  'url' => $wgSharedUploadPath,
333  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
334  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
335  'transformVia404' => !$wgGenerateThumbnailOnParse,
336  'dbType' => $wgDBtype,
337  'dbServer' => $wgDBserver,
338  'dbUser' => $wgDBuser,
339  'dbPassword' => $wgDBpassword,
340  'dbName' => $wgSharedUploadDBname,
341  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
342  'tablePrefix' => $wgSharedUploadDBprefix,
343  'hasSharedCache' => $wgCacheSharedUploads,
344  'descBaseUrl' => $wgRepositoryBaseUrl,
345  'fetchDescription' => $wgFetchCommonsDescriptions,
346  ];
347  } else {
348  $wgForeignFileRepos[] = [
349  'class' => FileRepo::class,
350  'name' => 'shared',
351  'directory' => $wgSharedUploadDirectory,
352  'url' => $wgSharedUploadPath,
353  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
354  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
355  'transformVia404' => !$wgGenerateThumbnailOnParse,
356  'descBaseUrl' => $wgRepositoryBaseUrl,
357  'fetchDescription' => $wgFetchCommonsDescriptions,
358  ];
359  }
360 }
361 if ( $wgUseInstantCommons ) {
362  $wgForeignFileRepos[] = [
363  'class' => ForeignAPIRepo::class,
364  'name' => 'wikimediacommons',
365  'apibase' => 'https://commons.wikimedia.org/w/api.php',
366  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
367  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
368  'hashLevels' => 2,
369  'transformVia404' => true,
370  'fetchDescription' => true,
371  'descriptionCacheExpiry' => 43200,
372  'apiThumbCacheExpiry' => 0,
373  ];
374 }
375 foreach ( $wgForeignFileRepos as &$repo ) {
376  if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) {
377  $repo['directory'] = $wgUploadDirectory; // b/c
378  }
379  if ( !isset( $repo['backend'] ) ) {
380  $repo['backend'] = $repo['name'] . '-backend';
381  }
382 }
383 unset( $repo ); // no global pollution; destroy reference
384 
385 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
386 // Ensure that default user options are not invalid, since that breaks Special:Preferences
387 $wgDefaultUserOptions['rcdays'] = min(
388  $wgDefaultUserOptions['rcdays'],
389  ceil( $rcMaxAgeDays )
390 );
391 $wgDefaultUserOptions['watchlistdays'] = min(
392  $wgDefaultUserOptions['watchlistdays'],
393  ceil( $rcMaxAgeDays )
394 );
395 unset( $rcMaxAgeDays );
396 
397 if ( !$wgCookiePrefix ) {
398  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
400  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
402  } elseif ( $wgDBprefix ) {
404  } else {
406  }
407 }
408 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
409 
410 if ( $wgEnableEmail ) {
412 } else {
413  // Disable all other email settings automatically if $wgEnableEmail
414  // is set to false. - T65678
415  $wgAllowHTMLEmail = false;
416  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
426  unset( $wgGroupPermissions['user']['sendemail'] );
427  $wgUseEnotif = false;
430 }
431 
432 // Ensure the minimum chunk size is less than PHP upload limits or the maximum
433 // upload size.
436  UploadBase::getMaxUploadSize( 'file' ),
437  UploadBase::getMaxPhpUploadSize(),
439  ini_get( 'post_max_size' ),
440  PHP_INT_MAX
441  ) ?: PHP_INT_MAX ) - 1024 // Leave some room for other POST parameters
442 );
443 
449 
451 if ( is_array( $wgExtraNamespaces ) ) {
453 }
454 
455 // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php
456 if ( count( $wgDummyLanguageCodes ) !== 0 ) {
457  wfDeprecated( '$wgDummyLanguageCodes', '1.29' );
458 }
459 // Merge in the legacy language codes, incorporating overrides from the config
461  // Internal language codes of the private-use area which get mapped to
462  // themselves.
463  'qqq' => 'qqq', // Used for message documentation
464  'qqx' => 'qqx', // Used for viewing message keys
466 // Merge in (inverted) BCP 47 mappings
467 foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) {
468  $bcp47 = strtolower( $bcp47 ); // force case-insensitivity
469  if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) {
470  $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code;
471  }
472 }
473 
475  Wikimedia\suppressWarnings();
476  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
477  Wikimedia\restoreWarnings();
478 }
479 
480 if ( $wgNewUserLog ) {
481  // Add new user log type
482  $wgLogTypes[] = 'newusers';
483  $wgLogNames['newusers'] = 'newuserlogpage';
484  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
485  $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
486  $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
487  $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
488  $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
489  $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
490 }
491 
492 if ( $wgPageCreationLog ) {
493  // Add page creation log type
494  $wgLogTypes[] = 'create';
495  $wgLogActionsHandlers['create/create'] = LogFormatter::class;
496 }
497 
498 if ( $wgPageLanguageUseDB ) {
499  $wgLogTypes[] = 'pagelang';
500  $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class;
501 }
502 
503 if ( $wgCookieSecure === 'detect' ) {
504  $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
505 }
506 
507 // Backwards compatibility with old password limits
508 if ( $wgMinimalPasswordLength !== false ) {
509  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
510 }
511 
512 if ( $wgMaximalPasswordLength !== false ) {
513  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
514 }
515 
516 if ( $wgPHPSessionHandling !== 'enable' &&
517  $wgPHPSessionHandling !== 'warn' &&
518  $wgPHPSessionHandling !== 'disable'
519 ) {
520  $wgPHPSessionHandling = 'warn';
521 }
522 if ( defined( 'MW_NO_SESSION' ) ) {
523  // If the entry point wants no session, force 'disable' here unless they
524  // specifically set it to the (undocumented) 'warn'.
525  // @phan-suppress-next-line PhanUndeclaredConstant
526  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
527 }
528 
530 
531 // Reset the global service locator, so any services that have already been created will be
532 // re-created while taking into account any custom settings and extensions.
533 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
534 
535 // Define a constant that indicates that the bootstrapping of the service locator
536 // is complete.
537 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
538 
540 
541 // T30798: $wgServer must be explicitly set
542 if ( $wgServer === false ) {
543  throw new FatalError(
544  '$wgServer must be set in LocalSettings.php. ' .
545  'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' .
546  'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.'
547  );
548 }
549 
550 if ( $wgCanonicalServer === false ) {
552 }
553 
554 // Set server name
556 if ( $wgServerName !== false ) {
557  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
558  . 'not customized. Overwriting $wgServerName.' );
559 }
561 unset( $serverParts );
562 
563 // Set defaults for configuration variables
564 // that are derived from the server name by default
565 // Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
566 if ( !$wgEmergencyContact ) {
567  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
568 }
569 if ( !$wgPasswordSender ) {
570  $wgPasswordSender = 'apache@' . $wgServerName;
571 }
572 if ( !$wgNoReplyAddress ) {
574 }
575 
576 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
577  $wgSecureLogin = false;
578  wfWarn( 'Secure login was enabled on a server that only supports '
579  . 'HTTP or HTTPS. Disabling secure login.' );
580 }
581 
583 
584 // Now that GlobalFunctions is loaded, set defaults that depend on it.
585 if ( $wgTmpDirectory === false ) {
587 }
588 
589 if ( $wgMainWANCache === false ) {
590  // Setup a WAN cache from $wgMainCacheType with no relayer.
591  // Sites using multiple datacenters can configure a relayer.
592  $wgMainWANCache = 'mediawiki-main-default';
594  'class' => WANObjectCache::class,
595  'cacheId' => $wgMainCacheType
596  ];
597 }
598 
599 if ( $wgSharedDB && $wgSharedTables ) {
600  // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
601  MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
602  array_fill_keys(
604  [
605  'dbname' => $wgSharedDB,
606  'schema' => $wgSharedSchema,
607  'prefix' => $wgSharedPrefix
608  ]
609  )
610  );
611 }
612 
613 // Raise the memory limit if it's too low
614 // Note, this makes use of wfDebug, and thus should not be before
615 // MWDebug::init() is called.
617 
623 if ( $wgLocaltimezone === null ) {
624  Wikimedia\suppressWarnings();
625  $wgLocaltimezone = date_default_timezone_get();
626  Wikimedia\restoreWarnings();
627 }
628 
629 date_default_timezone_set( $wgLocaltimezone );
630 if ( $wgLocalTZoffset === null ) {
631  $wgLocalTZoffset = (int)date( 'Z' ) / 60;
632 }
633 // The part after the System| is ignored, but rest of MW fills it
634 // out as the local offset.
635 $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
636 
637 if ( !$wgDBerrorLogTZ ) {
639 }
640 
641 // Initialize the request object in $wgRequest
642 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
643 // Set user IP/agent information for agent session consistency purposes
644 $cpPosInfo = LBFactory::getCPInfoFromCookieValue(
645  // The cookie has no prefix and is set by MediaWiki::preOutputCommit()
646  $wgRequest->getCookie( 'cpPosIndex', '' ),
647  // Mitigate broken client-side cookie expiration handling (T190082)
648  time() - ChronologyProtector::POSITION_COOKIE_TTL
649 );
650 MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
651  'IPAddress' => $wgRequest->getIP(),
652  'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
653  'ChronologyProtection' => $wgRequest->getHeader( 'MediaWiki-Chronology-Protection' ),
654  'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ),
655  'ChronologyClientId' => $cpPosInfo['clientId']
656  ?? $wgRequest->getHeader( 'MediaWiki-Chronology-Client-Id' )
657 ] );
658 unset( $cpPosInfo );
659 // Make sure that object caching does not undermine the ChronologyProtector improvements
660 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {
661  // The user is pinned to the primary DC, meaning that they made recent changes which should
662  // be reflected in their subsequent web requests. Avoid the use of interim cache keys because
663  // they use a blind TTL and could be stale if an object changes twice in a short time span.
664  MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false );
665 }
666 
667 // Useful debug output
668 if ( $wgCommandLineMode ) {
669  if ( isset( $self ) ) {
670  wfDebug( "\n\nStart command line script $self\n" );
671  }
672 } else {
673  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
674  $debug .= "HTTP HEADERS:\n";
675  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
676  $debug .= "$name: $value\n";
677  }
678  wfDebug( $debug );
679 }
680 
686 
687 // Most of the config is out, some might want to run hooks here.
688 Hooks::run( 'SetupAfterCache' );
689 
694 $wgContLang = MediaWikiServices::getInstance()->getContentLanguage();
695 
696 // Now that variant lists may be available...
697 $wgRequest->interpolateTitle();
698 
704 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
705  // If session.auto_start is there, we can't touch session name
706  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
707  session_name( $wgSessionName ?: $wgCookiePrefix . '_session' );
708  }
709 
710  // Create the SessionManager singleton and set up our session handler,
711  // unless we're specifically asked not to.
712  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
714  MediaWiki\Session\SessionManager::singleton()
715  );
716  }
717 
718  // Initialize the session
719  try {
721  } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
722  // The exception is because the request had multiple possible
723  // sessions tied for top priority. Report this to the user.
724  $list = [];
725  foreach ( $ex->getSessionInfos() as $info ) {
726  $list[] = $info->getProvider()->describe( $wgContLang );
727  }
728  $list = $wgContLang->listToText( $list );
729  throw new HttpError( 400,
730  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
731  );
732  }
733 
734  if ( $session->isPersistent() ) {
735  $wgInitialSessionId = $session->getSessionId();
736  }
737 
738  $session->renew();
739  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
740  ( $session->isPersistent() || $session->shouldRememberUser() ) &&
741  session_id() !== $session->getId()
742  ) {
743  // Start the PHP-session for backwards compatibility
744  if ( session_id() !== '' ) {
745  wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [
746  'old_id' => session_id(),
747  'new_id' => $session->getId(),
748  ] );
749  session_write_close();
750  }
751  session_id( $session->getId() );
752  session_start();
753  }
754 
755  unset( $session );
756 } else {
757  // Even if we didn't set up a global Session, still install our session
758  // handler unless specifically requested not to.
759  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
761  MediaWiki\Session\SessionManager::singleton()
762  );
763  }
764 }
765 
771 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
772 
777 
781 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
782 
787 $wgParser = new StubObject( 'wgParser', function () {
788  return MediaWikiServices::getInstance()->getParser();
789 } );
790 
794 $wgTitle = null;
795 
796 // Extension setup functions
797 // Entries should be added to this variable during the inclusion
798 // of the extension file. This allows the extension to perform
799 // any necessary initialisation in the fully initialised environment
800 foreach ( $wgExtensionFunctions as $func ) {
801  call_user_func( $func );
802 }
803 
804 // If the session user has a 0 id but a valid name, that means we need to
805 // autocreate it.
806 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
807  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
808  if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
809  $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
810  $sessionUser,
811  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
812  true
813  );
814  \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
815  'event' => 'autocreate',
816  'status' => $res,
817  ] );
818  unset( $res );
819  }
820  unset( $sessionUser );
821 }
822 
823 if ( !$wgCommandLineMode ) {
825 }
826 
$wgCanonicalNamespaceNames
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:448
$wgSharedUploadDirectory
string $wgSharedUploadDirectory
Shortcut for the 'directory' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:631
LanguageCode\getDeprecatedCodeMapping
static getDeprecatedCodeMapping()
Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up...
Definition: LanguageCode.php:124
MediaWiki\HeaderCallback\register
static register()
Register a callback to be called when headers are sent.
Definition: HeaderCallback.php:19
MediaWiki\Session\PHPSessionHandler\install
static install(SessionManager $manager)
Install a session handler for the current web request.
Definition: PHPSessionHandler.php:111
$wgUsersNotifiedOnAllChanges
$wgUsersNotifiedOnAllChanges
Definition: Setup.php:429
$wgMaximalPasswordLength
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
Definition: DefaultSettings.php:4995
MW_NO_SESSION
const MW_NO_SESSION
Definition: load.php:32
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:1950
$wgFileBlacklist
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
Definition: DefaultSettings.php:976
ObjectCache\getLocalClusterInstance
static getLocalClusterInstance()
Get the main cluster-local cache object.
Definition: ObjectCache.php:266
$serverParts
if( $wgServer===false) if( $wgCanonicalServer===false) $serverParts
Definition: Setup.php:555
$wgPageCreationLog
$wgPageCreationLog
Maintain a log of page creations at Special:Log/create?
Definition: DefaultSettings.php:8188
$wgParser
$wgParser
Definition: Setup.php:787
$wgEnotifFromEditor
$wgEnotifFromEditor
Definition: Setup.php:418
$wgInvalidateCacheOnLocalSettingsChange
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
Definition: DefaultSettings.php:2750
$wgRestPath
$wgRestPath
The URL path to the REST API Defaults to "{$wgScriptPath}/rest.php".
Definition: DefaultSettings.php:201
$wgGalleryOptions
$wgGalleryOptions
Default parameters for the "<gallery>" tag.
Definition: Setup.php:289
$wgTmpDirectory
$wgTmpDirectory
The local filesystem path to a temporary directory.
Definition: DefaultSettings.php:379
$wgRightsText
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link.
Definition: DefaultSettings.php:7427
$wgDBname
$wgDBname
Current wiki database name.
Definition: DefaultSettings.php:1925
$wgDefaultUserOptions
$wgDefaultUserOptions['rcdays']
Definition: Setup.php:387
$wgEnotifWatchlist
$wgEnotifWatchlist
Definition: Setup.php:425
$wgSharedTables
$wgSharedTables
Definition: DefaultSettings.php:2079
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:137
$wgSharedSchema
$wgSharedSchema
Definition: DefaultSettings.php:2085
StubObject
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition: StubObject.php:45
$wgLogHeaders
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
Definition: DefaultSettings.php:8043
$wgUserEmailUseReplyTo
$wgUserEmailUseReplyTo
Definition: Setup.php:428
$wgScript
$wgScript
The URL path to index.php.
Definition: DefaultSettings.php:186
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:1970
$wgSharedDB
$wgSharedDB
Shared database for multiple wikis.
Definition: DefaultSettings.php:2069
$wgLocalFileRepo
$wgLocalFileRepo
File repository structures.
Definition: DefaultSettings.php:566
$wgWANObjectCaches
$wgWANObjectCaches
Advanced WAN object cache configuration.
Definition: DefaultSettings.php:2491
$wgSharedUploadDBname
bool string $wgSharedUploadDBname
Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:676
DBO_DEBUG
const DBO_DEBUG
Definition: defines.php:9
wfMemoryLimit
wfMemoryLimit( $newLimit)
Raise PHP's memory limit (if needed).
Definition: GlobalFunctions.php:2697
$wgDBmwschema
$wgDBmwschema
Current wiki database schema name.
Definition: DefaultSettings.php:1935
$wgVirtualRestConfig
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:582
$wgNamespaceProtection
if( $wgRightsIcon) if(isset( $wgFooterIcons['copyright']['copyright']) && $wgFooterIcons['copyright']['copyright']===[]) if(isset( $wgFooterIcons['poweredby']) &&isset( $wgFooterIcons['poweredby']['mediawiki']) && $wgFooterIcons['poweredby']['mediawiki']['src']===null) $wgNamespaceProtection[NS_MEDIAWIKI]
Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a sysadmin to set $wgName...
Definition: Setup.php:270
$wgEnableUserEmail
$wgEnableUserEmail
Definition: Setup.php:417
NamespaceInfo\CANONICAL_NAMES
const CANONICAL_NAMES
Definitions of the NS_ constants are in Defines.php.
Definition: NamespaceInfo.php:59
$wgExtensionAssetsPath
$wgExtensionAssetsPath
The URL path of the extensions directory.
Definition: DefaultSettings.php:223
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
Environment checks.
Definition: Setup.php:55
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition: DefaultSettings.php:2353
User\isValidUserName
static isValidUserName( $name)
Is the input a valid username?
Definition: User.php:976
$res
$res
Definition: testCompression.php:57
$wgSharedThumbnailScriptPath
string $wgSharedThumbnailScriptPath
Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:944
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:272
wfDebugLog
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Definition: GlobalFunctions.php:995
$wgMemc
$wgMemc
Definition: Setup.php:685
$wgMetaNamespace
$wgMetaNamespace
Name of the project namespace.
Definition: DefaultSettings.php:4142
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:30
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:1965
$wgDBprefix
$wgDBprefix
Current wiki database table name prefix.
Definition: DefaultSettings.php:1945
$wgFetchCommonsDescriptions
bool $wgFetchCommonsDescriptions
Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:666
$wgStylePath
$wgStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:208
$wgRepositoryBaseUrl
$wgRepositoryBaseUrl
Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:657
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:385
$wgUseInstantCommons
$wgUseInstantCommons
Use Wikimedia Commons as a foreign file repository.
Definition: DefaultSettings.php:592
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:130
$wgHashedUploadDirectory
$wgHashedUploadDirectory
Set this to false if you do not want MediaWiki to divide your images directory into many subdirectori...
Definition: DefaultSettings.php:959
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:649
$wgNoReplyAddress
$wgNoReplyAddress
Reply-To address for e-mail notifications.
Definition: DefaultSettings.php:1712
$wgEnotifMaxRecips
$wgEnotifMaxRecips
Definition: Setup.php:420
$wgEmergencyContact
$wgEmergencyContact
Site admin email address.
Definition: DefaultSettings.php:1695
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1033
$wgFooterIcons
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
Definition: DefaultSettings.php:3516
$wgMainCacheType
$wgMainCacheType
Main cache type.
Definition: DefaultSettings.php:2372
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:28
$wgFileExtensions
if( $wgScript===false) if( $wgLoadScript===false) if( $wgRestPath===false) if( $wgArticlePath===false) if( $wgResourceBasePath===null) if( $wgStylePath===false) if( $wgLocalStylePath===false) if( $wgExtensionAssetsPath===false) if( $wgLogos !==false &&isset( $wgLogos['1x'])) if( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if( $wgGitInfoCacheDirectory===false && $wgCacheDirectory !==false) if( $wgSharedPrefix===false) if( $wgSharedSchema===false) if( $wgMetaNamespace===false) $wgFileExtensions
Expand dynamic defaults and shortcuts.
Definition: Setup.php:229
$wgLang
$wgLang
Definition: Setup.php:776
$wgDummyLanguageCodes
if(is_array( $wgExtraNamespaces)) if(count( $wgDummyLanguageCodes) !==0) $wgDummyLanguageCodes
Definition: Setup.php:460
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition: install.php:26
$wgEnotifUserTalk
$wgEnotifUserTalk
Definition: Setup.php:424
$wgLoadScript
$wgLoadScript
The URL path to load.php.
Definition: DefaultSettings.php:194
MediaWiki
A helper class for throttling authentication attempts.
$wgSharedPrefix
$wgSharedPrefix
Definition: DefaultSettings.php:2074
$wgLogTypes
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
Definition: DefaultSettings.php:7958
$wgEnotifUseRealName
$wgEnotifUseRealName
Definition: Setup.php:423
$wgEnableEmail
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
Definition: DefaultSettings.php:1719
$wgLogos
array false $wgLogos
The URL path to various wiki logos.
Definition: DefaultSettings.php:291
GlobalVarConfig
Accesses configuration settings from $GLOBALS.
Definition: GlobalVarConfig.php:28
$wgCookiePrefix
if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:408
$wgSessionName
$wgSessionName
Override to customise the session name.
Definition: DefaultSettings.php:6363
MWDebug\setup
static setup()
Definition: MWDebug.php:73
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:115
$wgEnotifRevealEditorAddress
$wgEnotifRevealEditorAddress
Definition: Setup.php:422
$wgMemoryLimit
$wgMemoryLimit
The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit i...
Definition: DefaultSettings.php:2328
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:275
$wgUseSharedUploads
bool $wgUseSharedUploads
Shortcut for adding an entry to $wgForeignFileRepos.
Definition: DefaultSettings.php:622
$wgFullyInitialised
foreach( $wgExtensionFunctions as $func) if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised
Definition: Setup.php:827
$wgPageLanguageUseDB
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
Definition: DefaultSettings.php:8980
$wgEnotifMinorEdits
$wgEnotifMinorEdits
Definition: Setup.php:421
MediaWiki\Session\SessionManager\getGlobalSession
static getGlobalSession()
Get the "global" session.
Definition: SessionManager.php:106
$wgTitle
$wgTitle
Definition: Setup.php:794
$wgLocalTZoffset
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
Definition: DefaultSettings.php:3257
$wgDeletedDirectory
$wgDeletedDirectory
What directory to place deleted uploads in.
Definition: DefaultSettings.php:464
$wgCacheSharedUploads
bool $wgCacheSharedUploads
Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
Definition: DefaultSettings.php:694
StubUserLang
Stub object for the user language.
Definition: StubUserLang.php:24
$wgServer
$wgServer
URL of the server.
Definition: DefaultSettings.php:106
$wgRCMaxAge
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
Definition: DefaultSettings.php:7064
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:81
$wgRightsIcon
$wgRightsIcon
Override for copyright metadata.
Definition: DefaultSettings.php:7432
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:208
$wgExtensionFunctions
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
Definition: DefaultSettings.php:7555
$wgEmailAuthentication
$wgEmailAuthentication
Definition: Setup.php:416
$wgUploadBaseUrl
$wgUploadBaseUrl
If set, this URL is added to the start of $wgUploadPath to form a complete upload URL.
Definition: DefaultSettings.php:386
$wgUploadDirectory
$wgUploadDirectory
The filesystem path of the images directory.
Definition: DefaultSettings.php:257
$wgAllowHTMLEmail
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
Definition: DefaultSettings.php:1811
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:451
$wgMinUploadChunkSize
$wgMinUploadChunkSize
Definition: Setup.php:434
$wgLogActionsHandlers
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
Definition: DefaultSettings.php:8071
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:2002
$wgResourceBasePath
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
Definition: DefaultSettings.php:3990
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:427
$wgArticlePath
$wgArticlePath
Definition: img_auth.php:48
$self
$self
Definition: doMaintenance.php:55
$wgCacheEpoch
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
Definition: DefaultSettings.php:2681
wfShorthandToInteger
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
Definition: GlobalFunctions.php:2743
$wgGitInfoCacheDirectory
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
Definition: DefaultSettings.php:2687
$debug
$debug
Definition: Setup.php:674
wfTempDir
wfTempDir()
Tries to get the system directory for temporary files.
Definition: GlobalFunctions.php:1887
$wgReadOnlyFile
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode.
Definition: DefaultSettings.php:7014
MediaWiki\Auth\AuthManager\singleton
static singleton()
Get the global AuthManager.
Definition: AuthManager.php:163
$wgThumbnailScriptPath
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
Definition: DefaultSettings.php:935
$wgGroupPermissions
$wgGroupPermissions
Permission keys given to users in each group.
Definition: DefaultSettings.php:5408
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:3246
$wgEnotifImpersonal
$wgEnotifImpersonal
Definition: Setup.php:419
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:685
$wgCookieSecure
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
Definition: DefaultSettings.php:6331
$wgShellLocale
$wgShellLocale
Locale for LC_ALL, to provide a known environment for locale-sensitive operations.
Definition: DefaultSettings.php:8644
$cpPosInfo
$cpPosInfo
Definition: Setup.php:644
$wgLogNames
$wgLogNames
Lists the message key string for each log type.
Definition: DefaultSettings.php:8020
$wgFileCacheDirectory
$wgFileCacheDirectory
Directory where the cached page will be saved.
Definition: DefaultSettings.php:263
$wgUploadPath
$wgUploadPath
The URL path for the images directory.
Definition: DefaultSettings.php:252
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:1054
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:77
$wgDBuser
$wgDBuser
Database username.
Definition: DefaultSettings.php:1960
$wgDBerrorLogTZ
$wgDBerrorLogTZ
Timezone to use in the error log.
Definition: DefaultSettings.php:2185
$wgPasswordPolicy
$wgPasswordPolicy
Password policy for the wiki.
Definition: DefaultSettings.php:4766
$wgDebugDumpSql
$wgDebugDumpSql
Write SQL queries to the debug log.
Definition: DefaultSettings.php:6451
$wgRequest
if(! $wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:642
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:4982
$wgServerName
if( $wgServerName !==false) $wgServerName
Definition: Setup.php:560
$wgOut
$wgOut
Definition: Setup.php:781
$wgPasswordSender
$wgPasswordSender
Sender email address for e-mail notifications.
Definition: DefaultSettings.php:1705
$wgPHPSessionHandling
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
Definition: DefaultSettings.php:2581
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:3069
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:138
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:140
$wgContLang
$wgContLang
Definition: Setup.php:694
$wgForeignFileRepos
$wgForeignFileRepos
Enable the use of files from one or more other wikis.
Definition: DefaultSettings.php:581
$wgLocalStylePath
$wgLocalStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:216
$wgSecureLogin
$wgSecureLogin
This is to let user authenticate using https when they come from http.
Definition: DefaultSettings.php:5226
$wgGenerateThumbnailOnParse
bool $wgGenerateThumbnailOnParse
Render thumbnails while parsing wikitext.
Definition: DefaultSettings.php:1350
$wgExtraNamespaces
$wgExtraNamespaces
Additional namespaces.
Definition: DefaultSettings.php:4179
$wgInitialSessionId
$wgInitialSessionId
Definition: Setup.php:703
$wgNewUserLog
$wgNewUserLog
Maintain a log of newusers at Special:Log/newusers?
Definition: DefaultSettings.php:8182
$wgMainWANCache
$wgMainWANCache
Main Wide-Area-Network cache type.
Definition: DefaultSettings.php:2475
$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:7419
$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:157
$wgSharedUploadPath
string $wgSharedUploadPath
Shortcut for the 'url' setting of $wgForeignFileRepos.
Definition: DefaultSettings.php:640