MediaWiki  master
Setup.php
Go to the documentation of this file.
1 <?php
27 
32 if ( !defined( 'MEDIAWIKI' ) ) {
33  exit( 1 );
34 }
35 
36 $fname = 'Setup.php';
37 $ps_setup = Profiler::instance()->scopedProfileIn( $fname );
38 
39 // If any extensions are still queued, force load them
40 ExtensionRegistry::getInstance()->loadFromQueue();
41 
42 // Check to see if we are at the file scope
43 if ( !isset( $wgVersion ) ) {
44  echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
45  die( 1 );
46 }
47 
48 mb_internal_encoding( 'UTF-8' );
49 
50 // Set various default paths sensibly...
51 $ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );
52 
53 if ( $wgScript === false ) {
54  $wgScript = "$wgScriptPath/index.php";
55 }
56 if ( $wgLoadScript === false ) {
57  $wgLoadScript = "$wgScriptPath/load.php";
58 }
59 
60 if ( $wgArticlePath === false ) {
61  if ( $wgUsePathInfo ) {
62  $wgArticlePath = "$wgScript/$1";
63  } else {
64  $wgArticlePath = "$wgScript?title=$1";
65  }
66 }
67 
68 if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
69  // 'view' is assumed the default action path everywhere in the code
70  // but is rarely filled in $wgActionPaths
72 }
73 
74 if ( $wgResourceBasePath === null ) {
76 }
77 if ( $wgStylePath === false ) {
78  $wgStylePath = "$wgResourceBasePath/skins";
79 }
80 if ( $wgLocalStylePath === false ) {
81  // Avoid wgResourceBasePath here since that may point to a different domain (e.g. CDN)
82  $wgLocalStylePath = "$wgScriptPath/skins";
83 }
84 if ( $wgExtensionAssetsPath === false ) {
85  $wgExtensionAssetsPath = "$wgResourceBasePath/extensions";
86 }
87 
88 if ( $wgLogo === false ) {
89  $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
90 }
91 
92 if ( $wgUploadPath === false ) {
93  $wgUploadPath = "$wgScriptPath/images";
94 }
95 if ( $wgUploadDirectory === false ) {
96  $wgUploadDirectory = "$IP/images";
97 }
98 if ( $wgReadOnlyFile === false ) {
99  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
100 }
101 if ( $wgFileCacheDirectory === false ) {
102  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
103 }
104 if ( $wgDeletedDirectory === false ) {
105  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
106 }
107 
108 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
109  $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
110 }
111 
112 if ( $wgEnableParserCache === false ) {
114 }
115 
116 // Fix path to icon images after they were moved in 1.24
117 if ( $wgRightsIcon ) {
118  $wgRightsIcon = str_replace(
119  "{$wgStylePath}/common/images/",
120  "{$wgResourceBasePath}/resources/assets/licenses/",
122  );
123 }
124 
125 if ( isset( $wgFooterIcons['copyright']['copyright'] )
126  && $wgFooterIcons['copyright']['copyright'] === []
127 ) {
128  if ( $wgRightsIcon || $wgRightsText ) {
129  $wgFooterIcons['copyright']['copyright'] = [
130  'url' => $wgRightsUrl,
131  'src' => $wgRightsIcon,
132  'alt' => $wgRightsText,
133  ];
134  }
135 }
136 
137 if ( isset( $wgFooterIcons['poweredby'] )
138  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
139  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
140 ) {
141  $wgFooterIcons['poweredby']['mediawiki']['src'] =
142  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
143  $wgFooterIcons['poweredby']['mediawiki']['srcset'] =
144  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " .
145  "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x";
146 }
147 
156 
164 
169  'name' => 'fsLockManager',
170  'class' => 'FSLockManager',
171  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
172 ];
173 $wgLockManagers[] = [
174  'name' => 'nullLockManager',
175  'class' => 'NullLockManager',
176 ];
177 
181 if ( !$wgLocalFileRepo ) {
182  $wgLocalFileRepo = [
183  'class' => 'LocalRepo',
184  'name' => 'local',
185  'directory' => $wgUploadDirectory,
186  'scriptDirUrl' => $wgScriptPath,
187  'scriptExtension' => '.php',
189  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
190  'thumbScriptUrl' => $wgThumbnailScriptPath,
191  'transformVia404' => !$wgGenerateThumbnailOnParse,
192  'deletedDir' => $wgDeletedDirectory,
193  'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0
194  ];
195 }
199 if ( $wgUseSharedUploads ) {
200  if ( $wgSharedUploadDBname ) {
201  $wgForeignFileRepos[] = [
202  'class' => 'ForeignDBRepo',
203  'name' => 'shared',
204  'directory' => $wgSharedUploadDirectory,
205  'url' => $wgSharedUploadPath,
206  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
207  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
208  'transformVia404' => !$wgGenerateThumbnailOnParse,
209  'dbType' => $wgDBtype,
210  'dbServer' => $wgDBserver,
211  'dbUser' => $wgDBuser,
212  'dbPassword' => $wgDBpassword,
213  'dbName' => $wgSharedUploadDBname,
214  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
215  'tablePrefix' => $wgSharedUploadDBprefix,
216  'hasSharedCache' => $wgCacheSharedUploads,
217  'descBaseUrl' => $wgRepositoryBaseUrl,
218  'fetchDescription' => $wgFetchCommonsDescriptions,
219  ];
220  } else {
221  $wgForeignFileRepos[] = [
222  'class' => 'FileRepo',
223  'name' => 'shared',
224  'directory' => $wgSharedUploadDirectory,
225  'url' => $wgSharedUploadPath,
226  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
227  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
228  'transformVia404' => !$wgGenerateThumbnailOnParse,
229  'descBaseUrl' => $wgRepositoryBaseUrl,
230  'fetchDescription' => $wgFetchCommonsDescriptions,
231  ];
232  }
233 }
234 if ( $wgUseInstantCommons ) {
235  $wgForeignFileRepos[] = [
236  'class' => 'ForeignAPIRepo',
237  'name' => 'wikimediacommons',
238  'apibase' => 'https://commons.wikimedia.org/w/api.php',
239  'url' => 'https://upload.wikimedia.org/wikipedia/commons',
240  'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
241  'hashLevels' => 2,
242  'transformVia404' => true,
243  'fetchDescription' => true,
244  'descriptionCacheExpiry' => 43200,
245  'apiThumbCacheExpiry' => 86400,
246  ];
247 }
248 /*
249  * Add on default file backend config for file repos.
250  * FileBackendGroup will handle initializing the backends.
251  */
252 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
253  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
254 }
255 foreach ( $wgForeignFileRepos as &$repo ) {
256  if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) {
257  $repo['directory'] = $wgUploadDirectory; // b/c
258  }
259  if ( !isset( $repo['backend'] ) ) {
260  $repo['backend'] = $repo['name'] . '-backend';
261  }
262 }
263 unset( $repo ); // no global pollution; destroy reference
264 
265 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
266 if ( $wgRCFilterByAge ) {
267  // Trim down $wgRCLinkDays so that it only lists links which are valid
268  // as determined by $wgRCMaxAge.
269  // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
270  sort( $wgRCLinkDays );
271 
272  // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
273  for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
274  // @codingStandardsIgnoreEnd
275  if ( $wgRCLinkDays[$i] >= $rcMaxAgeDays ) {
276  $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
277  break;
278  }
279  }
280 }
281 // Ensure that default user options are not invalid, since that breaks Special:Preferences
282 $wgDefaultUserOptions['rcdays'] = min(
283  $wgDefaultUserOptions['rcdays'],
284  ceil( $rcMaxAgeDays )
285 );
286 $wgDefaultUserOptions['watchlistdays'] = min(
287  $wgDefaultUserOptions['watchlistdays'],
288  ceil( $rcMaxAgeDays )
289 );
290 unset( $rcMaxAgeDays );
291 
292 if ( $wgSkipSkin ) {
294 }
295 
296 $wgSkipSkins[] = 'fallback';
297 $wgSkipSkins[] = 'apioutput';
298 
299 if ( $wgLocalInterwiki ) {
300  array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
301 }
302 
303 // Set default shared prefix
304 if ( $wgSharedPrefix === false ) {
306 }
307 
308 // Set default shared schema
309 if ( $wgSharedSchema === false ) {
311 }
312 
313 if ( !$wgCookiePrefix ) {
314  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
316  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
318  } elseif ( $wgDBprefix ) {
320  } else {
322  }
323 }
324 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
325 
326 if ( $wgEnableEmail ) {
328 } else {
329  // Disable all other email settings automatically if $wgEnableEmail
330  // is set to false. - bug 63678
331  $wgAllowHTMLEmail = false;
332  $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
342  unset( $wgGroupPermissions['user']['sendemail'] );
343  $wgUseEnotif = false;
346 }
347 
348 if ( $wgMetaNamespace === false ) {
349  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
350 }
351 
352 // Default value is 2000 or the suhosin limit if it is between 1 and 2000
353 if ( $wgResourceLoaderMaxQueryLength === false ) {
354  $suhosinMaxValueLength = (int)ini_get( 'suhosin.get.max_value_length' );
355  if ( $suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000 ) {
356  $wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength;
357  } else {
359  }
360  unset( $suhosinMaxValueLength );
361 }
362 
363 // Ensure the minimum chunk size is less than PHP upload limits or the maximum
364 // upload size.
370  ini_get( 'post_max_size' ) ?: ini_get( 'hhvm.server.max_post_size' ),
371  PHP_INT_MAX
372  ) ?: PHP_INT_MAX ) - 1024 // Leave some room for other POST parameters
373 );
374 
380  NS_MEDIA => 'Media',
381  NS_SPECIAL => 'Special',
382  NS_TALK => 'Talk',
383  NS_USER => 'User',
384  NS_USER_TALK => 'User_talk',
385  NS_PROJECT => 'Project',
386  NS_PROJECT_TALK => 'Project_talk',
387  NS_FILE => 'File',
388  NS_FILE_TALK => 'File_talk',
389  NS_MEDIAWIKI => 'MediaWiki',
390  NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
391  NS_TEMPLATE => 'Template',
392  NS_TEMPLATE_TALK => 'Template_talk',
393  NS_HELP => 'Help',
394  NS_HELP_TALK => 'Help_talk',
395  NS_CATEGORY => 'Category',
396  NS_CATEGORY_TALK => 'Category_talk',
397 ];
398 
400 if ( is_array( $wgExtraNamespaces ) ) {
402 }
403 
404 // These are now the same, always
405 // To determine the user language, use $wgLang->getCode()
407 
408 // Easy to forget to falsify $wgDebugToolbar for static caches.
409 // If file cache or CDN cache is on, just disable this (DWIMD).
410 if ( $wgUseFileCache || $wgUseSquid ) {
411  $wgDebugToolbar = false;
412 }
413 
414 // We always output HTML5 since 1.22, overriding these is no longer supported
415 // we set them here for extensions that depend on its value.
416 $wgHtml5 = true;
417 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
418 $wgJsMimeType = 'text/javascript';
419 
420 // Blacklisted file extensions shouldn't appear on the "allowed" list
421 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
422 
424  MediaWiki\suppressWarnings();
425  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
426  MediaWiki\restoreWarnings();
427 }
428 
429 if ( $wgNewUserLog ) {
430  // Add a new log type
431  $wgLogTypes[] = 'newusers';
432  $wgLogNames['newusers'] = 'newuserlogpage';
433  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
434  $wgLogActionsHandlers['newusers/newusers'] = 'NewUsersLogFormatter';
435  $wgLogActionsHandlers['newusers/create'] = 'NewUsersLogFormatter';
436  $wgLogActionsHandlers['newusers/create2'] = 'NewUsersLogFormatter';
437  $wgLogActionsHandlers['newusers/byemail'] = 'NewUsersLogFormatter';
438  $wgLogActionsHandlers['newusers/autocreate'] = 'NewUsersLogFormatter';
439 }
440 
441 if ( $wgPageLanguageUseDB ) {
442  $wgLogTypes[] = 'pagelang';
443  $wgLogActionsHandlers['pagelang/pagelang'] = 'PageLangLogFormatter';
444 }
445 
446 if ( $wgCookieSecure === 'detect' ) {
447  $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
448 }
449 
450 if ( $wgProfileOnly ) {
451  $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
452  $wgDebugLogFile = '';
453 }
454 
455 // Disable AuthManager API modules if $wgDisableAuthManager
456 if ( $wgDisableAuthManager ) {
457  $wgAPIModules += [
458  'clientlogin' => 'ApiDisabled',
459  'createaccount' => 'ApiCreateAccount', // Use the non-AuthManager version
460  'linkaccount' => 'ApiDisabled',
461  'unlinkaccount' => 'ApiDisabled',
462  'changeauthenticationdata' => 'ApiDisabled',
463  'removeauthenticationdata' => 'ApiDisabled',
464  'resetpassword' => 'ApiDisabled',
465  ];
466  $wgAPIMetaModules += [
467  'authmanagerinfo' => 'ApiQueryDisabled',
468  ];
469 }
470 
471 // Backwards compatibility with old password limits
472 if ( $wgMinimalPasswordLength !== false ) {
473  $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
474 }
475 
476 if ( $wgMaximalPasswordLength !== false ) {
477  $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
478 }
479 
480 // Backwards compatibility warning
482  wfDeprecated( '$wgSessionsInObjectCache = false', '1.27' );
483  if ( $wgSessionHandler ) {
484  wfDeprecated( '$wgSessionsHandler', '1.27' );
485  }
486  $cacheType = get_class( ObjectCache::getInstance( $wgSessionCacheType ) );
487  wfDebugLog(
488  'caches',
489  "Session data will be stored in \"$cacheType\" cache with " .
490  "expiry $wgObjectCacheSessionExpiry seconds"
491  );
492 }
494 
495 if ( $wgPHPSessionHandling !== 'enable' &&
496  $wgPHPSessionHandling !== 'warn' &&
497  $wgPHPSessionHandling !== 'disable'
498 ) {
499  $wgPHPSessionHandling = 'warn';
500 }
501 if ( defined( 'MW_NO_SESSION' ) ) {
502  // If the entry point wants no session, force 'disable' here unless they
503  // specifically set it to the (undocumented) 'warn'.
504  $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
505 }
506 
507 Profiler::instance()->scopedProfileOut( $ps_default );
508 
509 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
510 // all the memory from logging SQL queries on maintenance scripts
512 if ( $wgDebugToolbar && !$wgCommandLineMode ) {
513  MWDebug::init();
514 }
515 
516 if ( !class_exists( 'AutoLoader' ) ) {
517  require_once "$IP/includes/AutoLoader.php";
518 }
519 
520 // Reset the global service locator, so any services that have already been created will be
521 // re-created while taking into account any custom settings and extensions.
522 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
523 
524 // Define a constant that indicates that the bootstrapping of the service locator
525 // is complete.
526 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
527 
528 // Install a header callback to prevent caching of responses with cookies (T127993)
529 if ( !$wgCommandLineMode ) {
530  header_register_callback( function () {
531  $headers = [];
532  foreach ( headers_list() as $header ) {
533  list( $name, $value ) = explode( ':', $header, 2 );
534  $headers[strtolower( trim( $name ) )][] = trim( $value );
535  }
536 
537  if ( isset( $headers['set-cookie'] ) ) {
538  $cacheControl = isset( $headers['cache-control'] )
539  ? implode( ', ', $headers['cache-control'] )
540  : '';
541 
542  if ( !preg_match( '/(?:^|,)\s*(?:private|no-cache|no-store)\s*(?:$|,)/i', $cacheControl ) ) {
543  header( 'Expires: Thu, 01 Jan 1970 00:00:00 GMT' );
544  header( 'Cache-Control: private, max-age=0, s-maxage=0' );
545  MediaWiki\Logger\LoggerFactory::getInstance( 'cache-cookies' )->warning(
546  'Cookies set on {url} with Cache-Control "{cache-control}"', [
548  'cookies' => $headers['set-cookie'],
549  'cache-control' => $cacheControl ?: '<not set>',
550  ]
551  );
552  }
553  }
554  } );
555 }
556 
558 
559 require_once "$IP/includes/compat/normal/UtfNormalUtil.php";
560 
561 $ps_validation = Profiler::instance()->scopedProfileIn( $fname . '-validation' );
562 
563 // T48998: Bail out early if $wgArticlePath is non-absolute
564 foreach ( [ 'wgArticlePath', 'wgVariantArticlePath' ] as $varName ) {
565  if ( $$varName && !preg_match( '/^(https?:\/\/|\/)/', $$varName ) ) {
566  throw new FatalError(
567  "If you use a relative URL for \$$varName, it must start " .
568  'with a slash (<code>/</code>).<br><br>See ' .
569  "<a href=\"https://www.mediawiki.org/wiki/Manual:\$$varName\">" .
570  "https://www.mediawiki.org/wiki/Manual:\$$varName</a>."
571  );
572  }
573 }
574 
575 Profiler::instance()->scopedProfileOut( $ps_validation );
576 
577 $ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' );
578 
579 if ( $wgCanonicalServer === false ) {
581 }
582 
583 // Set server name
585 if ( $wgServerName !== false ) {
586  wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
587  . 'not customized. Overwriting $wgServerName.' );
588 }
590 unset( $serverParts );
591 
592 // Set defaults for configuration variables
593 // that are derived from the server name by default
594 // Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
595 if ( !$wgEmergencyContact ) {
596  $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
597 }
598 if ( !$wgPasswordSender ) {
599  $wgPasswordSender = 'apache@' . $wgServerName;
600 }
601 if ( !$wgNoReplyAddress ) {
603 }
604 
605 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
606  $wgSecureLogin = false;
607  wfWarn( 'Secure login was enabled on a server that only supports '
608  . 'HTTP or HTTPS. Disabling secure login.' );
609 }
610 
612 
613 // Now that GlobalFunctions is loaded, set defaults that depend on it.
614 if ( $wgTmpDirectory === false ) {
616 }
617 
618 // We don't use counters anymore. Left here for extensions still
619 // expecting this to exist. Should be removed sometime 1.26 or later.
620 if ( !isset( $wgDisableCounters ) ) {
621  $wgDisableCounters = true;
622 }
623 
624 if ( $wgMainWANCache === false ) {
625  // Setup a WAN cache from $wgMainCacheType with no relayer.
626  // Sites using multiple datacenters can configure a relayer.
627  $wgMainWANCache = 'mediawiki-main-default';
629  'class' => 'WANObjectCache',
630  'cacheId' => $wgMainCacheType,
631  'channels' => [ 'purge' => 'wancache-main-default-purge' ]
632  ];
633 }
634 
635 Profiler::instance()->scopedProfileOut( $ps_default2 );
636 
637 $ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc1' );
638 
639 // Raise the memory limit if it's too low
640 wfMemoryLimit();
641 
647 if ( is_null( $wgLocaltimezone ) ) {
648  MediaWiki\suppressWarnings();
649  $wgLocaltimezone = date_default_timezone_get();
650  MediaWiki\restoreWarnings();
651 }
652 
653 date_default_timezone_set( $wgLocaltimezone );
654 if ( is_null( $wgLocalTZoffset ) ) {
655  $wgLocalTZoffset = date( 'Z' ) / 60;
656 }
657 
658 if ( !$wgDBerrorLogTZ ) {
660 }
661 
662 // initialize the request object in $wgRequest
663 $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
664 
665 // Useful debug output
666 if ( $wgCommandLineMode ) {
667  wfDebug( "\n\nStart command line script $self\n" );
668 } else {
669  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
670 
671  if ( $wgDebugPrintHttpHeaders ) {
672  $debug .= "HTTP HEADERS:\n";
673 
674  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
675  $debug .= "$name: $value\n";
676  }
677  }
678  wfDebug( $debug );
679 }
680 
681 Profiler::instance()->scopedProfileOut( $ps_misc );
682 $ps_memcached = Profiler::instance()->scopedProfileIn( $fname . '-memcached' );
683 
687 
688 wfDebugLog( 'caches',
689  'cluster: ' . get_class( $wgMemc ) .
690  ', WAN: ' . $wgMainWANCache .
691  ', stash: ' . $wgMainStash .
692  ', message: ' . get_class( $messageMemc ) .
693  ', parser: ' . get_class( $parserMemc ) .
694  ', session: ' . get_class( ObjectCache::getInstance( $wgSessionCacheType ) )
695 );
696 
697 Profiler::instance()->scopedProfileOut( $ps_memcached );
698 
699 // Most of the config is out, some might want to run hooks here.
700 Hooks::run( 'SetupAfterCache' );
701 
702 $ps_globals = Profiler::instance()->scopedProfileIn( $fname . '-globals' );
703 
708 $wgContLang->initContLang();
709 
710 // Now that variant lists may be available...
711 $wgRequest->interpolateTitle();
712 
713 if ( !is_object( $wgAuth ) ) {
715  Hooks::run( 'AuthPluginSetup', [ &$wgAuth ] );
716 }
717 if ( !$wgDisableAuthManager &&
718  $wgAuth && !$wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin
719 ) {
720  MediaWiki\Auth\AuthManager::singleton()->forcePrimaryAuthenticationProviders( [
721  new MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider( [
722  'authoritative' => false,
723  ] ),
724  new MediaWiki\Auth\AuthPluginPrimaryAuthenticationProvider( $wgAuth ),
725  new MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider( [
726  'authoritative' => true,
727  ] ),
728  ], '$wgAuth is ' . get_class( $wgAuth ) );
729 }
730 
731 // Set up the session
732 $ps_session = Profiler::instance()->scopedProfileIn( $fname . '-session' );
738 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
739  // If session.auto_start is there, we can't touch session name
740  if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) {
741  session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
742  }
743 
744  // Create the SessionManager singleton and set up our session handler,
745  // unless we're specifically asked not to.
746  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
748  MediaWiki\Session\SessionManager::singleton()
749  );
750  }
751 
752  // Initialize the session
753  try {
755  } catch ( OverflowException $ex ) {
756  if ( isset( $ex->sessionInfos ) && count( $ex->sessionInfos ) >= 2 ) {
757  // The exception is because the request had multiple possible
758  // sessions tied for top priority. Report this to the user.
759  $list = [];
760  foreach ( $ex->sessionInfos as $info ) {
761  $list[] = $info->getProvider()->describe( $wgContLang );
762  }
763  $list = $wgContLang->listToText( $list );
764  throw new HttpError( 400,
765  Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
766  );
767  }
768 
769  // Not the one we want, rethrow
770  throw $ex;
771  }
772 
773  if ( $session->isPersistent() ) {
774  $wgInitialSessionId = $session->getSessionId();
775  }
776 
777  $session->renew();
778  if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
779  ( $session->isPersistent() || $session->shouldRememberUser() )
780  ) {
781  // Start the PHP-session for backwards compatibility
782  session_id( $session->getId() );
783  MediaWiki\quietCall( 'session_start' );
784  }
785 
786  unset( $session );
787 } else {
788  // Even if we didn't set up a global Session, still install our session
789  // handler unless specifically requested not to.
790  if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) {
792  MediaWiki\Session\SessionManager::singleton()
793  );
794  }
795 }
796 Profiler::instance()->scopedProfileOut( $ps_session );
797 
801 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
802 
807 
811 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
812 
816 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], [ $wgParserConf ] );
817 
821 $wgTitle = null;
822 
823 Profiler::instance()->scopedProfileOut( $ps_globals );
824 $ps_extensions = Profiler::instance()->scopedProfileIn( $fname . '-extensions' );
825 
826 // Extension setup functions
827 // Entries should be added to this variable during the inclusion
828 // of the extension file. This allows the extension to perform
829 // any necessary initialisation in the fully initialised environment
830 foreach ( $wgExtensionFunctions as $func ) {
831  // Allow closures in PHP 5.3+
832  if ( is_object( $func ) && $func instanceof Closure ) {
833  $profName = $fname . '-extensions-closure';
834  } elseif ( is_array( $func ) ) {
835  if ( is_object( $func[0] ) ) {
836  $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
837  } else {
838  $profName = $fname . '-extensions-' . implode( '::', $func );
839  }
840  } else {
841  $profName = $fname . '-extensions-' . strval( $func );
842  }
843 
844  $ps_ext_func = Profiler::instance()->scopedProfileIn( $profName );
845  call_user_func( $func );
846  Profiler::instance()->scopedProfileOut( $ps_ext_func );
847 }
848 
849 // If the session user has a 0 id but a valid name, that means we need to
850 // autocreate it.
851 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
852  $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
853  if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
854  $ps_autocreate = Profiler::instance()->scopedProfileIn( $fname . '-autocreate' );
855  if ( $wgDisableAuthManager ) {
857  } else {
858  $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
859  $sessionUser,
860  MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
861  true
862  );
863  }
864  Profiler::instance()->scopedProfileOut( $ps_autocreate );
865  \MediaWiki\Logger\LoggerFactory::getInstance( 'authmanager' )->info( 'Autocreation attempt', [
866  'event' => 'autocreate',
867  'status' => $res,
868  ] );
869  unset( $res );
870  }
871  unset( $sessionUser );
872 }
873 
874 if ( !$wgCommandLineMode ) {
876 }
877 
878 wfDebug( "Fully initialised\n" );
880 
881 Profiler::instance()->scopedProfileOut( $ps_extensions );
882 Profiler::instance()->scopedProfileOut( $ps_setup );
$wgInitialSessionId
Definition: Setup.php:737
$wgForeignFileRepos
$wgUseInstantCommons
Use Commons as a remote file repository.
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
$wgNewUserLog
Maintain a log of newusers at Log/newusers?
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
$wgMainStash
Main object stash type.
$wgHashedSharedUploadDirectory
Set the following to false especially if you have a set of files that need to be accessible by all wi...
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:379
$wgEnotifWatchlist
Definition: Setup.php:341
$wgScript
The URL path to index.php.
$wgRightsUrl
Set this to specify an external URL containing details about the content license used on your wiki...
$wgDBerrorLogTZ
Timezone to use in the error log.
$wgVersion
MediaWiki version number.
$wgSitename
Name of the site.
$wgUserEmailUseReplyTo
Definition: Setup.php:344
$ps_misc
Definition: Setup.php:637
$wgUsersNotifiedOnAllChanges
Definition: Setup.php:345
$wgLang
Definition: Setup.php:806
$ps_memcached
Definition: Setup.php:682
$wgDebugLogGroups
Map of string log group names to log destinations.
wfShorthandToInteger($string= '', $default=-1)
Converts shorthand byte notation to integer form.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgEnotifFromEditor
Definition: Setup.php:334
if($wgMetaNamespace===false) if($wgResourceLoaderMaxQueryLength===false) $wgMinUploadChunkSize
Definition: Setup.php:365
$wgParser
Definition: Setup.php:816
static instance()
Singleton.
Definition: Profiler.php:60
$wgDBpassword
Database user's password.
$wgSharedUploadDBname
DB name with metadata about shared directory.
$wgActionPaths
Definition: img_auth.php:46
$wgDebugToolbar
Display the new debugging toolbar.
if($wgInvalidateCacheOnLocalSettingsChange) if($wgNewUserLog) if($wgPageLanguageUseDB) if($wgCookieSecure=== 'detect') if($wgProfileOnly) if($wgDisableAuthManager) if($wgMinimalPasswordLength!==false) if($wgMaximalPasswordLength!==false) if(!$wgSessionsInObjectCache &&!$wgSessionsInMemcached) $wgSessionsInObjectCache
Definition: Setup.php:493
$wgThumbnailScriptPath
Give a path here to use thumb.php for thumbnail generation on client request, instead of generating t...
$wgRepositoryBaseUrl
Base URL for a repository wiki.
$wgDBtype
Database type.
static getInstance($channel)
Get a named logger instance from the currently configured logger factory.
$wgFileExtensions
Definition: Setup.php:421
static getInstance($id)
Get a cached instance of the specified type of cache object.
Definition: ObjectCache.php:93
$wgLocalFileRepo
File repository structures.
Authentication plugin interface.
Definition: AuthPlugin.php:38
$wgSecureLogin
This is to let user authenticate using https when they come from http.
$wgDBmwschema
Mediawiki schema.
$value
$wgMetaNamespace
Name of the project namespace.
$wgSharedTables
$wgDBserver
Database host name or IP address.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
Definition: injection.txt:23
if($wgUseFileCache||$wgUseSquid) $wgHtml5
Definition: Setup.php:416
$wgDBuser
Database username.
$wgMainWANCache
Main Wide-Area-Network cache type.
$wgSharedUploadDirectory
Path on the file system where shared uploads can be found.
The MediaWiki class is the helper class for the index.php entry point.
Definition: MediaWiki.php:28
$wgAuth $wgAuth
Authentication plugin.
static autoCreateUser(User $user)
Auto-create the given user, if necessary.
const DBO_DEBUG
Definition: Defines.php:30
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
$wgTmpDirectory
The local filesystem path to a temporary directory.
$wgEnableUserEmail
Definition: Setup.php:333
when a variable name is used in a it is silently declared as a new local masking the global
Definition: design.txt:93
wfExpandUrl($url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
$wgArticlePath
Definition: img_auth.php:45
$wgAPIModules
API module extensions.
$wgWANObjectCaches
Advanced WAN object cache configuration.
const NS_TEMPLATE
Definition: Defines.php:79
$wgMemc
Definition: Setup.php:684
$wgLogNames
Lists the message key string for each log type.
wfGetMessageCacheStorage()
Get the cache object used by the message cache.
$wgDebugLogFile
Filename for debug logging.
$wgGenerateThumbnailOnParse
Allow thumbnail rendering on page view.
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go...
$wgEnableEmail
Set to true to enable the e-mail basic features: Password reminders, etc.
const MW_NO_SESSION
Definition: load.php:29
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetParserCacheStorage()
Get the cache object used by the parser cache.
static getMaxUploadSize($forType=null)
Get the MediaWiki maximum uploaded file size for given type of upload, based on $wgMaxUploadSize.
$wgCacheDirectory
Directory for caching data in the local filesystem.
$wgDebugDumpSql
Write SQL queries to the debug log.
$wgInvalidateCacheOnLocalSettingsChange
Invalidate various caches when LocalSettings.php changes.
$wgGroupPermissions
Permission keys given to users in each group.
$wgUseSquid
Enable/disable CDN.
NS_SPECIAL
Definition: Setup.php:381
Show an error that looks like an HTTP server error.
Definition: HttpError.php:30
static isValidUserName($name)
Is the input a valid username?
Definition: User.php:840
if(is_array($wgExtraNamespaces)) $wgContLanguageCode
Definition: Setup.php:406
$wgLanguageCode
Site language code.
Accesses configuration settings from $GLOBALS.
wfDebugLog($logGroup, $text, $dest= 'all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not...
global $wgCommandLineMode
Definition: Setup.php:511
if($wgScript===false) if($wgLoadScript===false) if($wgArticlePath===false) if(!empty($wgActionPaths)&&!isset($wgActionPaths['view'])) 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($wgEnableParserCache===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:155
$rcMaxAgeDays
Definition: Setup.php:265
$wgStylePath
The URL path of the skins directory.
$wgPasswordPolicy
Password policy for local wiki users.
const NS_PROJECT
Definition: Defines.php:73
Backwards-compatibility wrapper for AuthManager via $wgAuth.
$wgParserCacheType
The cache type for storing article HTML.
wfTempDir()
Tries to get the system directory for temporary files.
static getMain()
Static methods.
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites...
$wgDeletedDirectory
What directory to place deleted uploads in.
$wgEnotifMaxRecips
Definition: Setup.php:336
static install(SessionManager $manager)
Install a session handler for the current web request.
wfWarn($msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfIniGetBool($setting)
Safety wrapper around ini_get() for boolean settings.
const NS_MEDIAWIKI_TALK
Definition: Defines.php:78
$wgEnotifUseRealName
Definition: Setup.php:339
$wgLocalInterwikis
Array for multiple $wgLocalInterwiki values, in case there are several interwiki prefixes that point ...
$wgSharedUploadPath
Full path on the web server where shared uploads can be found.
$ps_default
Definition: Setup.php:51
const NS_PROJECT_TALK
Definition: Defines.php:74
static singleton()
Get the global AuthManager.
const NS_MEDIA
Definition: Defines.php:57
$res
Definition: database.txt:21
$wgFullyInitialised
Definition: Setup.php:879
$ps_validation
Definition: Setup.php:561
$parserMemc
Definition: Setup.php:686
$wgEnotifRevealEditorAddress
Definition: Setup.php:338
$wgEnotifUserTalk
Definition: Setup.php:340
$wgUsePathInfo
Whether to support URLs like index.php/Page_title These often break when PHP is set up in CGI mode...
const NS_CATEGORY
Definition: Defines.php:83
$wgResourceBasePath
The default 'remoteBasePath' value for instances of ResourceLoaderFileModule.
$wgMaximalPasswordLength
Specifies the maximal length of a user password (T64685).
CACHE_MEMCACHED $wgMainCacheType
Definition: memcached.txt:63
wfDeprecated($function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
$ps_default2
Definition: Setup.php:577
$wgProfileOnly
Don't put non-profiling info into log file.
$wgEnotifMinorEdits
Definition: Setup.php:337
$wgSharedDB
Shared database for multiple wikis.
$wgEnableParserCache
Kept for extension compatibility; see $wgParserCacheType.
$wgTitle
Definition: Setup.php:821
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition: StubObject.php:44
$messageMemc
Definition: Setup.php:685
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:131
$wgRightsText
If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for the link...
static schedulePingback()
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send...
Definition: Pingback.php:250
$wgSessionName
Override to customise the session name.
const NS_FILE
Definition: Defines.php:75
const NS_FILE_TALK
Definition: Defines.php:76
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:239
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
$wgRCFilterByAge
Filter $wgRCLinkDays by $wgRCMaxAge to avoid showing links for numbers higher than what will be store...
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:168
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
$wgSessionsInMemcached
Deprecated alias for $wgSessionsInObjectCache.
const NS_MEDIAWIKI
Definition: Defines.php:77
const PROTO_HTTP
Definition: Defines.php:262
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
$wgJsMimeType
Definition: Setup.php:418
$wgPasswordSender
Sender email address for e-mail notifications.
if($wgServerName!==false) $wgServerName
Definition: Setup.php:589
$wgEmailAuthentication
Definition: Setup.php:332
Exception class which takes an HTML error message, and does not produce a backtrace.
Definition: FatalError.php:28
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
$wgSharedUploadDBprefix
Optional table prefix used in database.
static newFromKey($key)
Factory function that is just wrapper for the real constructor.
Definition: Message.php:379
$wgSessionCacheType
The cache type for storing session data.
$wgUploadPath
The URL path for the images directory.
$wgEmergencyContact
Site admin email address.
$wgExtraNamespaces
Additional namespaces.
static getGlobalSession()
Get the "global" session.
static getGlobalRequestURL()
Return the path and query string portion of the main request URI.
Definition: WebRequest.php:763
$wgReadOnlyFile
If this lock file exists (size > 0), the wiki will be forced into read-only mode. ...
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
if(!is_object($wgAuth)) if(!$wgDisableAuthManager &&$wgAuth &&!$wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin) $ps_session
Definition: Setup.php:732
if($wgCanonicalServer===false) $serverParts
Definition: Setup.php:584
$ps_setup
Definition: Setup.php:37
if($wgLocalInterwiki) if($wgSharedPrefix===false) if($wgSharedSchema===false) if(!$wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:324
$wgLocalStylePath
The URL path of the skins directory.
$wgUseEnotif
Definition: Setup.php:343
const NS_CATEGORY_TALK
Definition: Defines.php:84
$wgSharedThumbnailScriptPath
const NS_HELP
Definition: Defines.php:81
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined...
Definition: Setup.php:36
$wgMinimalPasswordLength
Specifies the minimal length of a user password.
static installHandler()
Install handlers with PHP.
if($wgSkipSkin) $wgSkipSkins[]
Definition: Setup.php:296
const NS_HELP_TALK
Definition: Defines.php:82
$wgNamespaceAliases['Image']
The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk".
Definition: Setup.php:162
$wgScriptPath
The path we should point to.
$wgLocalInterwiki
The interwiki prefix of the current wiki, or false if it doesn't have one.
$wgCacheSharedUploads
Cache shared metadata in memcached.
Stub object for the user language.
Definition: StubObject.php:169
wfGetMainCache()
Get the main cache object.
$wgExtensionAssetsPath
The URL path of the extensions directory.
if(!$wgEmergencyContact) if(!$wgPasswordSender) if(!$wgNoReplyAddress) if($wgSecureLogin &&substr($wgServer, 0, 2)!== '//') $wgVirtualRestConfig['global']['domain']
Definition: Setup.php:611
$wgDisableAuthManager
Disable AuthManager.
$ps_globals
Definition: Setup.php:702
$wgDBprefix
Table name prefix.
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
wfMemoryLimit()
Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit.
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type...
$ps_extensions
Definition: Setup.php:824
$wgCanonicalServer
Canonical URL of the server, to use in IRC feeds and notification e-mails.
const DBO_DEFAULT
Definition: Defines.php:34
$wgHashedUploadDirectory
Set this to false if you do not want MediaWiki to divide your images directory into many subdirectori...
$wgSessionHandler
$wgAPIMetaModules
API Query meta module extensions.
$wgLogo
The URL path of the wiki logo.
$wgXhtmlDefaultNamespace
Definition: Setup.php:417
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
static getMaxPhpUploadSize()
Get the PHP maximum uploaded file size, based on ini settings.
$wgServer
URL of the server.
$wgGitInfoCacheDirectory
Directory where GitInfo will look for pre-computed cache files.
$wgFetchCommonsDescriptions
Fetch commons image description pages and display them on the local wiki?
const NS_TALK
Definition: Defines.php:70
$wgOut
Definition: Setup.php:811
$wgContLang
Definition: Setup.php:707
$wgSharedPrefix
$wgEnotifImpersonal
Definition: Setup.php:335
$wgExtensionFunctions
A list of callback functions which are called once MediaWiki is fully initialised.
$wgUploadBaseUrl
If set, this URL is added to the start of $wgUploadPath to form a complete upload URL...
controlled by $wgMainCacheType controlled by $wgParserCacheType controlled by $wgMessageCacheType If you set CACHE_NONE to one of the three control default value for MediaWiki still create a but requests to it are no ops and we always fall through to the database If the cache daemon can t be it should also disable itself fairly smoothly By $wgMemc is used but when it is $parserMemc or $messageMemc this is mentioned $wgDBname
Definition: memcached.txt:96
$wgRCLinkDays
List of Days options to list in the Special:Recentchanges and Special:Recentchangeslinked pages...
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
const CACHE_NONE
Definition: Defines.php:102
$wgResourceLoaderMaxQueryLength
If set to a positive number, ResourceLoader will not generate URLs whose query string is more than th...
string $wgPHPSessionHandling
Whether to use PHP session handling ($_SESSION and session_*() functions)
$debug
Definition: mcc.php:31
wfParseUrl($url)
parse_url() work-alike, but non-broken.
static factory($code)
Get a cached or new language object for a given language code.
Definition: Language.php:179
$wgDebugPrintHttpHeaders
Print HTTP headers for every request in the debug information.
$wgRightsIcon
Override for copyright metadata.
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
const NS_USER_TALK
Definition: Defines.php:72
$wgSharedSchema
$wgLoadScript
The URL path to load.php.
$wgNoReplyAddress
Reply-To address for e-mail notifications.
$wgCacheEpoch
Set this to current time to invalidate all prior cached pages.
$wgFileCacheDirectory
Directory where the cached page will be saved.
static init()
Enabled the debugger and load resource module.
Definition: MWDebug.php:74
$wgUseSharedUploads
If you operate multiple wikis, you can define a shared upload path here.
if(is_null($wgLocalTZoffset)) if(!$wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:663
if($wgRCFilterByAge) $wgDefaultUserOptions['rcdays']
Definition: Setup.php:282
$wgUploadDirectory
The filesystem path of the images directory.
const NS_TEMPLATE_TALK
Definition: Defines.php:80
$wgUser
Definition: Setup.php:801
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:310