MediaWiki  1.23.14
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 
298 // Ensure the minimum chunk size is less than PHP upload limits or the maximum
299 // upload size.
302  $wgMaxUploadSize,
303  wfShorthandToInteger( ini_get( 'upload_max_filesize' ), 1e100 ),
304  wfShorthandToInteger( ini_get( 'post_max_size' ), 1e100) - 1024 # Leave room for other parameters
305 );
306 
312  NS_MEDIA => 'Media',
313  NS_SPECIAL => 'Special',
314  NS_TALK => 'Talk',
315  NS_USER => 'User',
316  NS_USER_TALK => 'User_talk',
317  NS_PROJECT => 'Project',
318  NS_PROJECT_TALK => 'Project_talk',
319  NS_FILE => 'File',
320  NS_FILE_TALK => 'File_talk',
321  NS_MEDIAWIKI => 'MediaWiki',
322  NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
323  NS_TEMPLATE => 'Template',
324  NS_TEMPLATE_TALK => 'Template_talk',
325  NS_HELP => 'Help',
326  NS_HELP_TALK => 'Help_talk',
327  NS_CATEGORY => 'Category',
328  NS_CATEGORY_TALK => 'Category_talk',
329 );
330 
332 if ( is_array( $wgExtraNamespaces ) ) {
334 }
335 
336 // These are now the same, always
337 // To determine the user language, use $wgLang->getCode()
338 $wgContLanguageCode = $wgLanguageCode;
339 
340 // Easy to forget to falsify $wgShowIPinHeader for static caches.
341 // If file cache or squid cache is on, just disable this (DWIMD).
342 // Do the same for $wgDebugToolbar.
343 if ( $wgUseFileCache || $wgUseSquid ) {
344  $wgShowIPinHeader = false;
345  $wgDebugToolbar = false;
346 }
347 
348 // Doesn't make sense to have if disabled.
349 if ( !$wgEnotifMinorEdits ) {
350  $wgHiddenPrefs[] = 'enotifminoredits';
351 }
352 
353 // We always output HTML5 since 1.22, overriding these is no longer supported
354 // we set them here for extensions that depend on its value.
355 $wgHtml5 = true;
356 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
357 $wgJsMimeType = 'text/javascript';
358 
359 if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
360  // see http://www.w3.org/TR/rdfa-in-html/#document-conformance
361  if ( $wgMimeType == 'application/xhtml+xml' ) {
362  $wgHtml5Version = 'XHTML+RDFa 1.0';
363  } else {
364  $wgHtml5Version = 'HTML+RDFa 1.0';
365  }
366 }
367 
368 // Blacklisted file extensions shouldn't appear on the "allowed" list
369 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) );
370 
371 if ( $wgArticleCountMethod === null ) {
372  $wgArticleCountMethod = $wgUseCommaCount ? 'comma' : 'link';
373 }
374 
375 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
376  $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
377 }
378 
379 if ( $wgNewUserLog ) {
380  // Add a new log type
381  $wgLogTypes[] = 'newusers';
382  $wgLogNames['newusers'] = 'newuserlogpage';
383  $wgLogHeaders['newusers'] = 'newuserlogpagetext';
384  $wgLogActionsHandlers['newusers/newusers'] = 'NewUsersLogFormatter';
385  $wgLogActionsHandlers['newusers/create'] = 'NewUsersLogFormatter';
386  $wgLogActionsHandlers['newusers/create2'] = 'NewUsersLogFormatter';
387  $wgLogActionsHandlers['newusers/byemail'] = 'NewUsersLogFormatter';
388  $wgLogActionsHandlers['newusers/autocreate'] = 'NewUsersLogFormatter';
389 }
390 
391 if ( $wgCookieSecure === 'detect' ) {
392  $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
393 }
394 
395 if ( $wgRC2UDPAddress ) {
396  $wgRCFeeds['default'] = array(
397  'formatter' => 'IRCColourfulRCFeedFormatter',
398  'uri' => "udp://$wgRC2UDPAddress:$wgRC2UDPPort/$wgRC2UDPPrefix",
399  'add_interwiki_prefix' => &$wgRC2UDPInterwikiPrefix,
400  'omit_bots' => &$wgRC2UDPOmitBots,
401  );
402 }
403 
404 wfProfileOut( $fname . '-defaults' );
405 
406 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
407 // all the memory from logging SQL queries on maintenance scripts
409 if ( $wgDebugToolbar && !$wgCommandLineMode ) {
410  wfProfileIn( $fname . '-debugtoolbar' );
411  MWDebug::init();
412  wfProfileOut( $fname . '-debugtoolbar' );
413 }
414 
415 if ( !class_exists( 'AutoLoader' ) ) {
416  require_once "$IP/includes/AutoLoader.php";
417 }
418 
419 wfProfileIn( $fname . '-exception' );
421 wfProfileOut( $fname . '-exception' );
422 
423 wfProfileIn( $fname . '-includes' );
424 require_once "$IP/includes/normal/UtfNormalUtil.php";
425 require_once "$IP/includes/normal/UtfNormalDefines.php";
426 wfProfileOut( $fname . '-includes' );
427 
428 wfProfileIn( $fname . '-validation' );
429 
430 // T48998: Bail out early if $wgArticlePath is non-absolute
431 if ( !preg_match( '/^(https?:\/\/|\/)/', $wgArticlePath ) ) {
432  throw new FatalError(
433  'If you use a relative URL for $wgArticlePath, it must start ' .
434  'with a slash (<code>/</code>).<br><br>See ' .
435  '<a href="https://www.mediawiki.org/wiki/Manual:$wgArticlePath">' .
436  'https://www.mediawiki.org/wiki/Manual:$wgArticlePath</a>.'
437  );
438 }
439 
440 wfProfileOut( $fname . '-validation' );
441 
442 wfProfileIn( $fname . '-defaults2' );
443 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
444  $wgSecureLogin = false;
445  wfWarn( 'Secure login was enabled on a server that only supports HTTP or HTTPS. Disabling secure login.' );
446 }
447 
448 // Now that GlobalFunctions is loaded, set defaults that depend
449 // on it.
450 if ( $wgTmpDirectory === false ) {
451  wfProfileIn( $fname . '-tempDir' );
452  $wgTmpDirectory = wfTempDir();
453  wfProfileOut( $fname . '-tempDir' );
454 }
455 
456 if ( $wgCanonicalServer === false ) {
457  $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
458 }
459 
460 // $wgHTCPMulticastRouting got renamed to $wgHTCPRouting in MediaWiki 1.22
461 // ensure back compatibility.
462 if ( !$wgHTCPRouting && $wgHTCPMulticastRouting ) {
463  $wgHTCPRouting = $wgHTCPMulticastRouting;
464 }
465 
466 // Initialize $wgHTCPRouting from backwards-compatible settings that
467 // comes from pre 1.20 version.
468 if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
469  $wgHTCPRouting = array(
470  '' => array(
471  'host' => $wgHTCPMulticastAddress,
472  'port' => $wgHTCPPort,
473  )
474  );
475 }
476 
477 // Back compatibility for $wgRateLimitLog deprecated with 1.23
478 if ( $wgRateLimitLog && ! array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
479  $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
480 }
481 
482 if ( $wgProfileOnly ) {
483  $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
484  $wgDebugLogFile = '';
485 }
486 
487 wfProfileOut( $fname . '-defaults2' );
488 wfProfileIn( $fname . '-misc1' );
489 
490 // Raise the memory limit if it's too low
491 wfMemoryLimit();
492 
498 if ( is_null( $wgLocaltimezone ) ) {
500  $wgLocaltimezone = date_default_timezone_get();
502 }
503 
504 date_default_timezone_set( $wgLocaltimezone );
505 if ( is_null( $wgLocalTZoffset ) ) {
506  $wgLocalTZoffset = date( 'Z' ) / 60;
507 }
508 
509 // Useful debug output
510 if ( $wgCommandLineMode ) {
511  $wgRequest = new FauxRequest( array() );
512 
513  wfDebug( "\n\nStart command line script $self\n" );
514 } else {
515  // Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
516  $wgRequest = new WebRequest;
517 
518  $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
519 
520  if ( $wgDebugPrintHttpHeaders ) {
521  $debug .= "HTTP HEADERS:\n";
522 
523  foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
524  $debug .= "$name: $value\n";
525  }
526  }
527  wfDebug( $debug );
528 }
529 
530 wfProfileOut( $fname . '-misc1' );
531 wfProfileIn( $fname . '-memcached' );
532 
537 
538 wfDebugLog( 'caches', 'main: ' . get_class( $wgMemc ) .
539  ', message: ' . get_class( $messageMemc ) .
540  ', parser: ' . get_class( $parserMemc ) );
541 
542 wfProfileOut( $fname . '-memcached' );
543 
544 // Most of the config is out, some might want to run hooks here.
545 wfRunHooks( 'SetupAfterCache' );
546 
547 wfProfileIn( $fname . '-session' );
548 
549 // If session.auto_start is there, we can't touch session name
550 if ( !wfIniGetBool( 'session.auto_start' ) ) {
551  session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
552 }
553 
554 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
555  if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
556  wfSetupSession();
557  $wgSessionStarted = true;
558  } else {
559  $wgSessionStarted = false;
560  }
561 }
562 
563 wfProfileOut( $fname . '-session' );
564 wfProfileIn( $fname . '-globals' );
565 
566 $wgContLang = Language::factory( $wgLanguageCode );
567 $wgContLang->initEncoding();
568 $wgContLang->initContLang();
569 
570 // Now that variant lists may be available...
571 $wgRequest->interpolateTitle();
572 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
573 
578 
582 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
583 
587 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
588 
589 if ( !is_object( $wgAuth ) ) {
590  $wgAuth = new AuthPlugin;
591  wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
592 }
593 
594 # Placeholders in case of DB error
595 $wgTitle = null;
596 
598 
599 wfProfileOut( $fname . '-globals' );
600 wfProfileIn( $fname . '-extensions' );
601 
602 // Extension setup functions for extensions other than skins
603 // Entries should be added to this variable during the inclusion
604 // of the extension file. This allows the extension to perform
605 // any necessary initialisation in the fully initialised environment
606 foreach ( $wgExtensionFunctions as $func ) {
607  // Allow closures in PHP 5.3+
608  if ( is_object( $func ) && $func instanceof Closure ) {
609  $profName = $fname . '-extensions-closure';
610  } elseif ( is_array( $func ) ) {
611  if ( is_object( $func[0] ) ) {
612  $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
613  } else {
614  $profName = $fname . '-extensions-' . implode( '::', $func );
615  }
616  } else {
617  $profName = $fname . '-extensions-' . strval( $func );
618  }
619 
620  wfProfileIn( $profName );
621  call_user_func( $func );
622  wfProfileOut( $profName );
623 }
624 
625 wfDebug( "Fully initialised\n" );
627 
628 wfProfileOut( $fname . '-extensions' );
$wgCanonicalNamespaceNames
$wgCanonicalNamespaceNames
Definitions of the NS_ constants are in Defines.php.
Definition: Setup.php:311
$wgUser
$wgUser
Definition: Setup.php:572
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
$wgMinUploadChunkSize
if( $wgMetaNamespace===false) if( $wgResourceLoaderMaxQueryLength===false) $wgMinUploadChunkSize
Definition: Setup.php:300
wfSetupSession
wfSetupSession( $sessionId=false)
Initialise php session.
Definition: GlobalFunctions.php:3587
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:577
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
$wgHtml5
if( $wgUseFileCache|| $wgUseSquid) if(! $wgEnotifMinorEdits) $wgHtml5
Definition: Setup.php:355
$wgDeferredUpdateList
$wgDeferredUpdateList
Definition: Setup.php:597
$wgMemc
$wgMemc
Definition: Setup.php:533
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:68
wfGetMainCache
wfGetMainCache()
Get the main cache object.
Definition: GlobalFunctions.php:4022
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:338
$wgFullyInitialised
$wgFullyInitialised
Definition: Setup.php:626
$wgCommandLineMode
global $wgCommandLineMode
Definition: Setup.php:408
$parserMemc
$parserMemc
Definition: Setup.php:535
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:582
$wgLangConvMemc
$wgLangConvMemc
Definition: Setup.php:536
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4066
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:369
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:3925
$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:534
$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:595
PROTO_HTTP
const PROTO_HTTP
Definition: Defines.php:267
$wgJsMimeType
$wgJsMimeType
Definition: Setup.php:357
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:4042
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:4032
wfShorthandToInteger
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
Definition: GlobalFunctions.php:3954
$wgXhtmlDefaultNamespace
$wgXhtmlDefaultNamespace
Definition: Setup.php:356
$debug
$debug
Definition: Setup.php:518
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:4052
$wgParser
$wgParser
Definition: Setup.php:587
NS_HELP_TALK
const NS_HELP_TALK
Definition: Defines.php:92
FatalError
Exception class which takes an HTML error message, and does not produce a backtrace.
Definition: FatalError.php:28
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:566
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