MediaWiki  1.23.10
Setup.php
Go to the documentation of this file.
1 <?php
31 if ( !defined( 'MEDIAWIKI' ) ) {
32  exit( 1 );
33 }
34 
35 $fname = 'Setup.php';
37 wfProfileIn( $fname . '-defaults' );
38 
39 // Check to see if we are at the file scope
40 if ( !isset( $wgVersion ) ) {
41  echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
42  die( 1 );
43 }
44 
45 // Set various default paths sensibly...
46 if ( $wgScript === false ) {
47  $wgScript = "$wgScriptPath/index$wgScriptExtension";
48 }
49 if ( $wgLoadScript === false ) {
50  $wgLoadScript = "$wgScriptPath/load$wgScriptExtension";
51 }
52 
53 if ( $wgArticlePath === false ) {
54  if ( $wgUsePathInfo ) {
55  $wgArticlePath = "$wgScript/$1";
56  } else {
57  $wgArticlePath = "$wgScript?title=$1";
58  }
59 }
60 
61 if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
62  // 'view' is assumed the default action path everywhere in the code
63  // but is rarely filled in $wgActionPaths
65 }
66 
67 if ( $wgStylePath === false ) {
68  $wgStylePath = "$wgScriptPath/skins";
69 }
70 if ( $wgLocalStylePath === false ) {
71  $wgLocalStylePath = "$wgScriptPath/skins";
72 }
73 if ( $wgStyleDirectory === false ) {
74  $wgStyleDirectory = "$IP/skins";
75 }
76 if ( $wgExtensionAssetsPath === false ) {
77  $wgExtensionAssetsPath = "$wgScriptPath/extensions";
78 }
79 
80 if ( $wgLogo === false ) {
81  $wgLogo = "$wgStylePath/common/images/wiki.png";
82 }
83 
84 if ( $wgUploadPath === false ) {
85  $wgUploadPath = "$wgScriptPath/images";
86 }
87 if ( $wgUploadDirectory === false ) {
88  $wgUploadDirectory = "$IP/images";
89 }
90 if ( $wgReadOnlyFile === false ) {
91  $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
92 }
93 if ( $wgFileCacheDirectory === false ) {
94  $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
95 }
96 if ( $wgDeletedDirectory === false ) {
97  $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
98 }
99 
100 if ( isset( $wgFileStore['deleted']['directory'] ) ) {
101  $wgDeletedDirectory = $wgFileStore['deleted']['directory'];
102 }
103 
104 if ( isset( $wgFooterIcons['copyright'] )
105  && isset( $wgFooterIcons['copyright']['copyright'] )
106  && $wgFooterIcons['copyright']['copyright'] === array()
107 ) {
108  if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
109  $wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon;
110  } elseif ( $wgRightsIcon || $wgRightsText ) {
111  $wgFooterIcons['copyright']['copyright'] = array(
112  'url' => $wgRightsUrl,
113  'src' => $wgRightsIcon,
114  'alt' => $wgRightsText,
115  );
116  } else {
117  unset( $wgFooterIcons['copyright']['copyright'] );
118  }
119 }
120 
121 if ( isset( $wgFooterIcons['poweredby'] )
122  && isset( $wgFooterIcons['poweredby']['mediawiki'] )
123  && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
124 ) {
125  $wgFooterIcons['poweredby']['mediawiki']['src'] = "$wgStylePath/common/images/poweredby_mediawiki_88x31.png";
126 }
127 
136 
144 
149  'name' => 'fsLockManager',
150  'class' => 'FSLockManager',
151  'lockDirectory' => "{$wgUploadDirectory}/lockdir",
152 );
154  'name' => 'nullLockManager',
155  'class' => 'NullLockManager',
156 );
157 
161 if ( !$wgLocalFileRepo ) {
162  if ( isset( $wgFileStore['deleted']['hash'] ) ) {
163  $deletedHashLevel = $wgFileStore['deleted']['hash'];
164  } else {
165  $deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0;
166  }
167  $wgLocalFileRepo = array(
168  'class' => 'LocalRepo',
169  'name' => 'local',
170  'directory' => $wgUploadDirectory,
171  'scriptDirUrl' => $wgScriptPath,
172  'scriptExtension' => $wgScriptExtension,
173  'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
174  'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
175  'thumbScriptUrl' => $wgThumbnailScriptPath,
176  'transformVia404' => !$wgGenerateThumbnailOnParse,
177  'deletedDir' => $wgDeletedDirectory,
178  'deletedHashLevels' => $deletedHashLevel
179  );
180 }
184 if ( $wgUseSharedUploads ) {
185  if ( $wgSharedUploadDBname ) {
186  $wgForeignFileRepos[] = array(
187  'class' => 'ForeignDBRepo',
188  'name' => 'shared',
189  'directory' => $wgSharedUploadDirectory,
190  'url' => $wgSharedUploadPath,
191  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
192  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
193  'transformVia404' => !$wgGenerateThumbnailOnParse,
194  'dbType' => $wgDBtype,
195  'dbServer' => $wgDBserver,
196  'dbUser' => $wgDBuser,
197  'dbPassword' => $wgDBpassword,
198  'dbName' => $wgSharedUploadDBname,
199  'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
200  'tablePrefix' => $wgSharedUploadDBprefix,
201  'hasSharedCache' => $wgCacheSharedUploads,
202  'descBaseUrl' => $wgRepositoryBaseUrl,
203  'fetchDescription' => $wgFetchCommonsDescriptions,
204  );
205  } else {
206  $wgForeignFileRepos[] = array(
207  'class' => 'FileRepo',
208  'name' => 'shared',
209  'directory' => $wgSharedUploadDirectory,
210  'url' => $wgSharedUploadPath,
211  'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
212  'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
213  'transformVia404' => !$wgGenerateThumbnailOnParse,
214  'descBaseUrl' => $wgRepositoryBaseUrl,
215  'fetchDescription' => $wgFetchCommonsDescriptions,
216  );
217  }
218 }
219 if ( $wgUseInstantCommons ) {
220  $wgForeignFileRepos[] = array(
221  'class' => 'ForeignAPIRepo',
222  'name' => 'wikimediacommons',
223  'apibase' => 'https://commons.wikimedia.org/w/api.php',
224  'hashLevels' => 2,
225  'fetchDescription' => true,
226  'descriptionCacheExpiry' => 43200,
227  'apiThumbCacheExpiry' => 86400,
228  );
229 }
230 /*
231  * Add on default file backend config for file repos.
232  * FileBackendGroup will handle initializing the backends.
233  */
234 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
235  $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
236 }
237 foreach ( $wgForeignFileRepos as &$repo ) {
238  if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) {
239  $repo['directory'] = $wgUploadDirectory; // b/c
240  }
241  if ( !isset( $repo['backend'] ) ) {
242  $repo['backend'] = $repo['name'] . '-backend';
243  }
244 }
245 unset( $repo ); // no global pollution; destroy reference
246 
247 if ( $wgRCFilterByAge ) {
248  // Trim down $wgRCLinkDays so that it only lists links which are valid
249  // as determined by $wgRCMaxAge.
250  // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
251  sort( $wgRCLinkDays );
252  for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
253  if ( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) {
254  $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
255  break;
256  }
257  }
258 }
259 
260 if ( $wgSkipSkin ) {
261  $wgSkipSkins[] = $wgSkipSkin;
262 }
263 
264 if ( $wgLocalInterwiki ) {
265  array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
266 }
267 
268 // Set default shared prefix
269 if ( $wgSharedPrefix === false ) {
270  $wgSharedPrefix = $wgDBprefix;
271 }
272 
273 if ( !$wgCookiePrefix ) {
274  if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
275  $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
276  } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
277  $wgCookiePrefix = $wgSharedDB;
278  } elseif ( $wgDBprefix ) {
279  $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
280  } else {
282  }
283 }
284 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
285 
286 $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
287 
288 if ( $wgMetaNamespace === false ) {
289  $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
290 }
291 
292 // Default value is either the suhosin limit or -1 for unlimited
293 if ( $wgResourceLoaderMaxQueryLength === false ) {
294  $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
295  $wgResourceLoaderMaxQueryLength = $maxValueLength > 0 ? $maxValueLength : -1;
296 }
297 
303  NS_MEDIA => 'Media',
304  NS_SPECIAL => 'Special',
305  NS_TALK => 'Talk',
306  NS_USER => 'User',
307  NS_USER_TALK => 'User_talk',
308  NS_PROJECT => 'Project',
309  NS_PROJECT_TALK => 'Project_talk',
310  NS_FILE => 'File',
311  NS_FILE_TALK => 'File_talk',
312  NS_MEDIAWIKI => 'MediaWiki',
313  NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
314  NS_TEMPLATE => 'Template',
315  NS_TEMPLATE_TALK => 'Template_talk',
316  NS_HELP => 'Help',
317  NS_HELP_TALK => 'Help_talk',
318  NS_CATEGORY => 'Category',
319  NS_CATEGORY_TALK => 'Category_talk',
320 );
321 
323 if ( is_array( $wgExtraNamespaces ) ) {
325 }
326 
327 // These are now the same, always
328 // To determine the user language, use $wgLang->getCode()
329 $wgContLanguageCode = $wgLanguageCode;
330 
331 // Easy to forget to falsify $wgShowIPinHeader for static caches.
332 // If file cache or squid cache is on, just disable this (DWIMD).
333 // Do the same for $wgDebugToolbar.
334 if ( $wgUseFileCache || $wgUseSquid ) {
335  $wgShowIPinHeader = false;
336  $wgDebugToolbar = false;
337 }
338 
339 // Doesn't make sense to have if disabled.
340 if ( !$wgEnotifMinorEdits ) {
341  $wgHiddenPrefs[] = 'enotifminoredits';
342 }
343 
344 // We always output HTML5 since 1.22, overriding these is no longer supported
345 // we set them here for extensions that depend on its value.
346 $wgHtml5 = true;
347 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
348 $wgJsMimeType = 'text/javascript';
349 
350 if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
351  // see http://www.w3.org/TR/rdfa-in-html/#document-conformance
352  if ( $wgMimeType == 'application/xhtml+xml' ) {
353  $wgHtml5Version = 'XHTML+RDFa 1.0';
354  } else {
355  $wgHtml5Version = 'HTML+RDFa 1.0';
356  }
357 }
358 
359 // Blacklisted file extensions shouldn't appear on the "allowed" list
360 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) );
361 
362 if ( $wgArticleCountMethod === null ) {
363  $wgArticleCountMethod = $wgUseCommaCount ? 'comma' : 'link';
364 }
365 
366 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
367  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
368 }
369 
370 if ( $wgNewUserLog ) {
371  // Add a new log type
372  $wgLogTypes[] = 'newusers';
373  $wgLogNames['newusers'] = 'newuserlogpage';
374  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
375  $wgLogActionsHandlers['newusers/newusers'] = 'NewUsersLogFormatter';
376  $wgLogActionsHandlers['newusers/create'] = 'NewUsersLogFormatter';
377  $wgLogActionsHandlers['newusers/create2'] = 'NewUsersLogFormatter';
378  $wgLogActionsHandlers['newusers/byemail'] = 'NewUsersLogFormatter';
379  $wgLogActionsHandlers['newusers/autocreate'] = 'NewUsersLogFormatter';
380 }
381 
382 if ( $wgCookieSecure === 'detect' ) {
383  $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
384 }
385 
386 if ( $wgRC2UDPAddress ) {
387  $wgRCFeeds['default'] = array(
388  'formatter' => 'IRCColourfulRCFeedFormatter',
389  'uri' => "udp://$wgRC2UDPAddress:$wgRC2UDPPort/$wgRC2UDPPrefix",
390  'add_interwiki_prefix' => &$wgRC2UDPInterwikiPrefix,
391  'omit_bots' => &$wgRC2UDPOmitBots,
392  );
393 }
394 
395 wfProfileOut( $fname . '-defaults' );
396 
397 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
398 // all the memory from logging SQL queries on maintenance scripts
400 if ( $wgDebugToolbar && !$wgCommandLineMode ) {
401  wfProfileIn( $fname . '-debugtoolbar' );
402  MWDebug::init();
403  wfProfileOut( $fname . '-debugtoolbar' );
404 }
405 
406 if ( !class_exists( 'AutoLoader' ) ) {
407  require_once "$IP/includes/AutoLoader.php";
408 }
409 
410 wfProfileIn( $fname . '-exception' );
412 wfProfileOut( $fname . '-exception' );
413 
414 wfProfileIn( $fname . '-includes' );
415 require_once "$IP/includes/normal/UtfNormalUtil.php";
416 require_once "$IP/includes/GlobalFunctions.php";
417 require_once "$IP/includes/normal/UtfNormalDefines.php";
418 wfProfileOut( $fname . '-includes' );
419 
420 wfProfileIn( $fname . '-defaults2' );
421 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
422  $wgSecureLogin = false;
423  wfWarn( 'Secure login was enabled on a server that only supports HTTP or HTTPS. Disabling secure login.' );
424 }
425 
426 // Now that GlobalFunctions is loaded, set defaults that depend
427 // on it.
428 if ( $wgTmpDirectory === false ) {
429  wfProfileIn( $fname . '-tempDir' );
430  $wgTmpDirectory = wfTempDir();
431  wfProfileOut( $fname . '-tempDir' );
432 }
433 
434 if ( $wgCanonicalServer === false ) {
435  $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
436 }
437 
438 // $wgHTCPMulticastRouting got renamed to $wgHTCPRouting in MediaWiki 1.22
439 // ensure back compatibility.
440 if ( !$wgHTCPRouting && $wgHTCPMulticastRouting ) {
441  $wgHTCPRouting = $wgHTCPMulticastRouting;
442 }
443 
444 // Initialize $wgHTCPRouting from backwards-compatible settings that
445 // comes from pre 1.20 version.
446 if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
447  $wgHTCPRouting = array(
448  '' => array(
449  'host' => $wgHTCPMulticastAddress,
450  'port' => $wgHTCPPort,
451  )
452  );
453 }
454 
455 // Back compatibility for $wgRateLimitLog deprecated with 1.23
456 if ( $wgRateLimitLog && ! array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
457  $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
458 }
459 
460 if ( $wgProfileOnly ) {
461  $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
462  $wgDebugLogFile = '';
463 }
464 
465 wfProfileOut( $fname . '-defaults2' );
466 wfProfileIn( $fname . '-misc1' );
467 
468 // Raise the memory limit if it's too low
469 wfMemoryLimit();
470 
476 if ( is_null( $wgLocaltimezone ) ) {
478  $wgLocaltimezone = date_default_timezone_get();
480 }
481 
482 date_default_timezone_set( $wgLocaltimezone );
483 if ( is_null( $wgLocalTZoffset ) ) {
484  $wgLocalTZoffset = date( 'Z' ) / 60;
485 }
486 
487 // Useful debug output
488 if ( $wgCommandLineMode ) {
489  $wgRequest = new FauxRequest( array() );
490 
491  wfDebug( "\n\nStart command line script $self\n" );
492 } else {
493  // Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
494  $wgRequest = new WebRequest;
495 
496  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
497 
498  if ( $wgDebugPrintHttpHeaders ) {
499  $debug .= "HTTP HEADERS:\n";
500 
501  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
502  $debug .= "$name: $value\n";
503  }
504  }
505  wfDebug( $debug );
506 }
507 
508 wfProfileOut( $fname . '-misc1' );
509 wfProfileIn( $fname . '-memcached' );
510 
515 
516 wfDebugLog( 'caches', 'main: ' . get_class( $wgMemc ) .
517  ', message: ' . get_class( $messageMemc ) .
518  ', parser: ' . get_class( $parserMemc ) );
519 
520 wfProfileOut( $fname . '-memcached' );
521 
522 // Most of the config is out, some might want to run hooks here.
523 wfRunHooks( 'SetupAfterCache' );
524 
525 wfProfileIn( $fname . '-session' );
526 
527 // If session.auto_start is there, we can't touch session name
528 if ( !wfIniGetBool( 'session.auto_start' ) ) {
529  session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
530 }
531 
532 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
533  if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
534  wfSetupSession();
535  $wgSessionStarted = true;
536  } else {
537  $wgSessionStarted = false;
538  }
539 }
540 
541 wfProfileOut( $fname . '-session' );
542 wfProfileIn( $fname . '-globals' );
543 
544 $wgContLang = Language::factory( $wgLanguageCode );
545 $wgContLang->initEncoding();
546 $wgContLang->initContLang();
547 
548 // Now that variant lists may be available...
549 $wgRequest->interpolateTitle();
550 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
551 
556 
560 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
561 
565 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
566 
567 if ( !is_object( $wgAuth ) ) {
568  $wgAuth = new AuthPlugin;
569  wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
570 }
571 
572 # Placeholders in case of DB error
573 $wgTitle = null;
574 
576 
577 wfProfileOut( $fname . '-globals' );
578 wfProfileIn( $fname . '-extensions' );
579 
580 // Extension setup functions for extensions other than skins
581 // Entries should be added to this variable during the inclusion
582 // of the extension file. This allows the extension to perform
583 // any necessary initialisation in the fully initialised environment
584 foreach ( $wgExtensionFunctions as $func ) {
585  // Allow closures in PHP 5.3+
586  if ( is_object( $func ) && $func instanceof Closure ) {
587  $profName = $fname . '-extensions-closure';
588  } elseif ( is_array( $func ) ) {
589  if ( is_object( $func[0] ) ) {
590  $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
591  } else {
592  $profName = $fname . '-extensions-' . implode( '::', $func );
593  }
594  } else {
595  $profName = $fname . '-extensions-' . strval( $func );
596  }
597 
598  wfProfileIn( $profName );
599  call_user_func( $func );
600  wfProfileOut( $profName );
601 }
602 
603 wfDebug( "Fully initialised\n" );
605 
606 wfProfileOut( $fname . '-extensions' );
$wgUser
$wgUser
Definition: Setup.php:550
FauxRequest
WebRequest clone which takes values from a provided array.
Definition: WebRequest.php:1275
$wgActionPaths
$wgActionPaths
Definition: img_auth.php:49
NS_HELP
const NS_HELP
Definition: Defines.php:91
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
wfSetupSession
wfSetupSession( $sessionId=false)
Initialise php session.
Definition: GlobalFunctions.php:3579
StubObject
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition: StubObject.php:44
NS_TEMPLATE_TALK
const NS_TEMPLATE_TALK
Definition: Defines.php:90
$wgLang
$wgLang
Definition: Setup.php:555
wfDebugLog
wfDebugLog( $logGroup, $text, $dest='all')
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Definition: GlobalFunctions.php:1087
wfProfileIn
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
$wgCookiePrefix
if( $wgRCFilterByAge) if( $wgSkipSkin) if( $wgLocalInterwiki) if( $wgSharedPrefix===false) if(! $wgCookiePrefix) $wgCookiePrefix
Definition: Setup.php:284
wfSuppressWarnings
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
Definition: GlobalFunctions.php:2434
$fname
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
Definition: Setup.php:35
NS_FILE
const NS_FILE
Definition: Defines.php:85
NS_TEMPLATE
const NS_TEMPLATE
Definition: Defines.php:89
MWExceptionHandler\installHandler
static installHandler()
Install an exception handler for MediaWiki exception types.
Definition: MWExceptionHandler.php:29
WebRequest\detectProtocol
static detectProtocol()
Detect the protocol from $_SERVER.
Definition: WebRequest.php:202
$wgCanonicalNamespaceNames
if( $wgMetaNamespace===false) if( $wgResourceLoaderMaxQueryLength===false) $wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:302
$wgHtml5
if( $wgUseFileCache|| $wgUseSquid) if(! $wgEnotifMinorEdits) $wgHtml5
Definition: Setup.php:346
$wgDeferredUpdateList
$wgDeferredUpdateList
Definition: Setup.php:575
$wgMemc
$wgMemc
Definition: Setup.php:511
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:68
wfGetMainCache
wfGetMainCache()
Get the main cache object.
Definition: GlobalFunctions.php:4013
NS_PROJECT
const NS_PROJECT
Definition: Defines.php:83
$wgDBname
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
wfRestoreWarnings
wfRestoreWarnings()
Restore error level to previous value.
Definition: GlobalFunctions.php:2464
$wgContLanguageCode
if(is_array( $wgExtraNamespaces)) $wgContLanguageCode
Definition: Setup.php:329
$wgFullyInitialised
$wgFullyInitialised
Definition: Setup.php:604
$wgCommandLineMode
global $wgCommandLineMode
Definition: Setup.php:399
$parserMemc
$parserMemc
Definition: Setup.php:513
NS_MEDIAWIKI_TALK
const NS_MEDIAWIKI_TALK
Definition: Defines.php:88
wfProfileOut
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
$wgOut
$wgOut
Definition: Setup.php:560
$wgLangConvMemc
$wgLangConvMemc
Definition: Setup.php:514
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4057
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
$wgFileExtensions
if(! $wgHtml5Version && $wgAllowRdfaAttributes) $wgFileExtensions
Definition: Setup.php:360
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:93
wfMemoryLimit
wfMemoryLimit()
Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit;.
Definition: GlobalFunctions.php:3917
$wgLockManagers
$wgLockManagers[]
Initialise $wgLockManagers to include basic FS version.
Definition: Setup.php:148
wfDebug
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:980
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:82
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
$messageMemc
$messageMemc
Definition: Setup.php:512
$value
$value
Definition: styleTest.css.php:45
NS_MEDIA
const NS_MEDIA
Definition: Defines.php:67
$wgNamespaceAliases
$wgNamespaceAliases['Image']
The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk".
Definition: Setup.php:142
StubUserLang
Stub object for the user language.
Definition: StubObject.php:190
$wgTitle
if(!is_object( $wgAuth)) $wgTitle
Definition: Setup.php:573
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:267
$wgJsMimeType
$wgJsMimeType
Definition: Setup.php:348
NS_PROJECT_TALK
const NS_PROJECT_TALK
Definition: Defines.php:84
MWDebug\init
static init()
Enabled the debugger and load resource module.
Definition: Debug.php:76
wfGetParserCacheStorage
wfGetParserCacheStorage()
Get the cache object used by the parser cache.
Definition: GlobalFunctions.php:4033
RequestContext\getMain
static getMain()
Static methods.
Definition: RequestContext.php:420
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition: GlobalFunctions.php:2732
WebRequest
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form,...
Definition: WebRequest.php:38
$wgUseEnotif
$wgUseEnotif
Definition: Setup.php:286
$wgArticlePath
$wgArticlePath
Definition: img_auth.php:48
DBO_DEFAULT
const DBO_DEFAULT
Definition: Defines.php:43
wfGetMessageCacheStorage
wfGetMessageCacheStorage()
Get the cache object used by the message cache.
Definition: GlobalFunctions.php:4023
$wgXhtmlDefaultNamespace
$wgXhtmlDefaultNamespace
Definition: Setup.php:347
$debug
$debug
Definition: Setup.php:496
wfTempDir
wfTempDir()
Tries to get the system directory for temporary files.
Definition: GlobalFunctions.php:2611
wfGetLangConverterCacheStorage
wfGetLangConverterCacheStorage()
Get the cache object used by the language converter.
Definition: GlobalFunctions.php:4043
$wgParser
$wgParser
Definition: Setup.php:565
NS_HELP_TALK
const NS_HELP_TALK
Definition: Defines.php:92
as
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
NS_USER
const NS_USER
Definition: Defines.php:81
$wgNamespaceProtection
if(!isset( $wgVersion)) if( $wgScript===false) if( $wgLoadScript===false) if( $wgArticlePath===false) if(!empty( $wgActionPaths) &&!isset( $wgActionPaths['view'])) if( $wgStylePath===false) if( $wgLocalStylePath===false) if( $wgStyleDirectory===false) if( $wgExtensionAssetsPath===false) if( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if(isset( $wgFileStore['deleted']['directory'])) if(isset( $wgFooterIcons['copyright']) &&isset( $wgFooterIcons['copyright']['copyright']) && $wgFooterIcons['copyright']['copyright']===array()) 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:135
NS_TALK
const NS_TALK
Definition: Defines.php:80
Language\factory
static factory( $code)
Get a cached or new language object for a given language code.
Definition: Language.php:184
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:1188
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:87
NS_FILE_TALK
const NS_FILE_TALK
Definition: Defines.php:86
NS_CATEGORY_TALK
const NS_CATEGORY_TALK
Definition: Defines.php:94
$wgContLang
$wgContLang
Definition: Setup.php:544
DBO_DEBUG
const DBO_DEBUG
Definition: Defines.php:39
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:544
AuthPlugin
Authentication plugin interface.
Definition: AuthPlugin.php:36