MediaWiki
REL1_24
|
00001 <?php 00031 if ( !defined( 'MEDIAWIKI' ) ) { 00032 exit( 1 ); 00033 } 00034 00035 $fname = 'Setup.php'; 00036 wfProfileIn( $fname ); 00037 wfProfileIn( $fname . '-defaults' ); 00038 00039 // Check to see if we are at the file scope 00040 if ( !isset( $wgVersion ) ) { 00041 echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n"; 00042 die( 1 ); 00043 } 00044 00045 // Set various default paths sensibly... 00046 00047 if ( $wgScript === false ) { 00048 $wgScript = "$wgScriptPath/index$wgScriptExtension"; 00049 } 00050 if ( $wgLoadScript === false ) { 00051 $wgLoadScript = "$wgScriptPath/load$wgScriptExtension"; 00052 } 00053 00054 if ( $wgArticlePath === false ) { 00055 if ( $wgUsePathInfo ) { 00056 $wgArticlePath = "$wgScript/$1"; 00057 } else { 00058 $wgArticlePath = "$wgScript?title=$1"; 00059 } 00060 } 00061 00062 if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) { 00063 // 'view' is assumed the default action path everywhere in the code 00064 // but is rarely filled in $wgActionPaths 00065 $wgActionPaths['view'] = $wgArticlePath; 00066 } 00067 00068 if ( $wgStylePath === false ) { 00069 $wgStylePath = "$wgScriptPath/skins"; 00070 } 00071 if ( $wgLocalStylePath === false ) { 00072 $wgLocalStylePath = "$wgScriptPath/skins"; 00073 } 00074 if ( $wgStyleDirectory === false ) { 00075 $wgStyleDirectory = "$IP/skins"; 00076 } 00077 if ( $wgExtensionAssetsPath === false ) { 00078 $wgExtensionAssetsPath = "$wgScriptPath/extensions"; 00079 } 00080 if ( $wgResourceBasePath === null ) { 00081 $wgResourceBasePath = $wgScriptPath; 00082 } 00083 00084 if ( $wgLogo === false ) { 00085 $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png"; 00086 } 00087 00088 if ( $wgUploadPath === false ) { 00089 $wgUploadPath = "$wgScriptPath/images"; 00090 } 00091 if ( $wgUploadDirectory === false ) { 00092 $wgUploadDirectory = "$IP/images"; 00093 } 00094 if ( $wgReadOnlyFile === false ) { 00095 $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR"; 00096 } 00097 if ( $wgFileCacheDirectory === false ) { 00098 $wgFileCacheDirectory = "{$wgUploadDirectory}/cache"; 00099 } 00100 if ( $wgDeletedDirectory === false ) { 00101 $wgDeletedDirectory = "{$wgUploadDirectory}/deleted"; 00102 } 00103 00104 if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) { 00105 $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo"; 00106 } 00107 00108 // Fix path to icon images after they were moved in 1.24 00109 if ( $wgRightsIcon ) { 00110 $wgRightsIcon = str_replace( 00111 "{$wgStylePath}/common/images/", 00112 "{$wgResourceBasePath}/resources/assets/licenses/", 00113 $wgRightsIcon 00114 ); 00115 } 00116 00117 if ( isset( $wgFooterIcons['copyright'] ) 00118 && isset( $wgFooterIcons['copyright']['copyright'] ) 00119 && $wgFooterIcons['copyright']['copyright'] === array() 00120 ) { 00121 if ( $wgCopyrightIcon ) { 00122 $wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon; 00123 } elseif ( $wgRightsIcon || $wgRightsText ) { 00124 $wgFooterIcons['copyright']['copyright'] = array( 00125 'url' => $wgRightsUrl, 00126 'src' => $wgRightsIcon, 00127 'alt' => $wgRightsText, 00128 ); 00129 } else { 00130 unset( $wgFooterIcons['copyright']['copyright'] ); 00131 } 00132 } 00133 00134 if ( isset( $wgFooterIcons['poweredby'] ) 00135 && isset( $wgFooterIcons['poweredby']['mediawiki'] ) 00136 && $wgFooterIcons['poweredby']['mediawiki']['src'] === null 00137 ) { 00138 $wgFooterIcons['poweredby']['mediawiki']['src'] = 00139 "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"; 00140 } 00141 00149 $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'; 00150 00156 $wgNamespaceAliases['Image'] = NS_FILE; 00157 $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; 00158 00162 $wgLockManagers[] = array( 00163 'name' => 'fsLockManager', 00164 'class' => 'FSLockManager', 00165 'lockDirectory' => "{$wgUploadDirectory}/lockdir", 00166 ); 00167 $wgLockManagers[] = array( 00168 'name' => 'nullLockManager', 00169 'class' => 'NullLockManager', 00170 ); 00171 00175 if ( !$wgLocalFileRepo ) { 00176 $wgLocalFileRepo = array( 00177 'class' => 'LocalRepo', 00178 'name' => 'local', 00179 'directory' => $wgUploadDirectory, 00180 'scriptDirUrl' => $wgScriptPath, 00181 'scriptExtension' => $wgScriptExtension, 00182 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath, 00183 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0, 00184 'thumbScriptUrl' => $wgThumbnailScriptPath, 00185 'transformVia404' => !$wgGenerateThumbnailOnParse, 00186 'deletedDir' => $wgDeletedDirectory, 00187 'deletedHashLevels' => $wgHashedUploadDirectory ? 3 : 0 00188 ); 00189 } 00193 if ( $wgUseSharedUploads ) { 00194 if ( $wgSharedUploadDBname ) { 00195 $wgForeignFileRepos[] = array( 00196 'class' => 'ForeignDBRepo', 00197 'name' => 'shared', 00198 'directory' => $wgSharedUploadDirectory, 00199 'url' => $wgSharedUploadPath, 00200 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0, 00201 'thumbScriptUrl' => $wgSharedThumbnailScriptPath, 00202 'transformVia404' => !$wgGenerateThumbnailOnParse, 00203 'dbType' => $wgDBtype, 00204 'dbServer' => $wgDBserver, 00205 'dbUser' => $wgDBuser, 00206 'dbPassword' => $wgDBpassword, 00207 'dbName' => $wgSharedUploadDBname, 00208 'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT, 00209 'tablePrefix' => $wgSharedUploadDBprefix, 00210 'hasSharedCache' => $wgCacheSharedUploads, 00211 'descBaseUrl' => $wgRepositoryBaseUrl, 00212 'fetchDescription' => $wgFetchCommonsDescriptions, 00213 ); 00214 } else { 00215 $wgForeignFileRepos[] = array( 00216 'class' => 'FileRepo', 00217 'name' => 'shared', 00218 'directory' => $wgSharedUploadDirectory, 00219 'url' => $wgSharedUploadPath, 00220 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0, 00221 'thumbScriptUrl' => $wgSharedThumbnailScriptPath, 00222 'transformVia404' => !$wgGenerateThumbnailOnParse, 00223 'descBaseUrl' => $wgRepositoryBaseUrl, 00224 'fetchDescription' => $wgFetchCommonsDescriptions, 00225 ); 00226 } 00227 } 00228 if ( $wgUseInstantCommons ) { 00229 $wgForeignFileRepos[] = array( 00230 'class' => 'ForeignAPIRepo', 00231 'name' => 'wikimediacommons', 00232 'apibase' => WebRequest::detectProtocol() === 'https' ? 00233 'https://commons.wikimedia.org/w/api.php' : 00234 'http://commons.wikimedia.org/w/api.php', 00235 'hashLevels' => 2, 00236 'fetchDescription' => true, 00237 'descriptionCacheExpiry' => 43200, 00238 'apiThumbCacheExpiry' => 86400, 00239 ); 00240 } 00241 /* 00242 * Add on default file backend config for file repos. 00243 * FileBackendGroup will handle initializing the backends. 00244 */ 00245 if ( !isset( $wgLocalFileRepo['backend'] ) ) { 00246 $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend'; 00247 } 00248 foreach ( $wgForeignFileRepos as &$repo ) { 00249 if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) { 00250 $repo['directory'] = $wgUploadDirectory; // b/c 00251 } 00252 if ( !isset( $repo['backend'] ) ) { 00253 $repo['backend'] = $repo['name'] . '-backend'; 00254 } 00255 } 00256 unset( $repo ); // no global pollution; destroy reference 00257 00258 if ( $wgRCFilterByAge ) { 00259 // Trim down $wgRCLinkDays so that it only lists links which are valid 00260 // as determined by $wgRCMaxAge. 00261 // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link. 00262 sort( $wgRCLinkDays ); 00263 00264 // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed 00265 for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) { 00266 // @codingStandardsIgnoreEnd 00267 if ( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) { 00268 $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false ); 00269 break; 00270 } 00271 } 00272 } 00273 00274 if ( $wgSkipSkin ) { 00275 $wgSkipSkins[] = $wgSkipSkin; 00276 } 00277 00278 // Register skins 00279 // Use a closure to avoid leaking into global state 00280 call_user_func( function () use ( $wgValidSkinNames ) { 00281 $factory = SkinFactory::getDefaultInstance(); 00282 foreach ( $wgValidSkinNames as $name => $skin ) { 00283 $factory->register( $name, $skin, function () use ( $name, $skin ) { 00284 $class = "Skin$skin"; 00285 return new $class( $name ); 00286 } ); 00287 } 00288 // Register a hidden "fallback" skin 00289 $factory->register( 'fallback', 'Fallback', function () { 00290 return new SkinFallback; 00291 } ); 00292 } ); 00293 $wgSkipSkins[] = 'fallback'; 00294 00295 if ( $wgLocalInterwiki ) { 00296 array_unshift( $wgLocalInterwikis, $wgLocalInterwiki ); 00297 } 00298 00299 // Set default shared prefix 00300 if ( $wgSharedPrefix === false ) { 00301 $wgSharedPrefix = $wgDBprefix; 00302 } 00303 00304 if ( !$wgCookiePrefix ) { 00305 if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) { 00306 $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix; 00307 } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) { 00308 $wgCookiePrefix = $wgSharedDB; 00309 } elseif ( $wgDBprefix ) { 00310 $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix; 00311 } else { 00312 $wgCookiePrefix = $wgDBname; 00313 } 00314 } 00315 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' ); 00316 00317 if ( $wgEnableEmail ) { 00318 $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist; 00319 } else { 00320 // Disable all other email settings automatically if $wgEnableEmail 00321 // is set to false. - bug 63678 00322 $wgAllowHTMLEmail = false; 00323 $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway 00324 $wgEnableUserEmail = false; 00325 $wgEnotifFromEditor = false; 00326 $wgEnotifImpersonal = false; 00327 $wgEnotifMaxRecips = 0; 00328 $wgEnotifMinorEdits = false; 00329 $wgEnotifRevealEditorAddress = false; 00330 $wgEnotifUseJobQ = false; 00331 $wgEnotifUseRealName = false; 00332 $wgEnotifUserTalk = false; 00333 $wgEnotifWatchlist = false; 00334 unset( $wgGroupPermissions['user']['sendemail'] ); 00335 $wgUseEnotif = false; 00336 $wgUserEmailUseReplyTo = false; 00337 $wgUsersNotifiedOnAllChanges = array(); 00338 } 00339 00340 // Doesn't make sense to have if disabled. 00341 if ( !$wgEnotifMinorEdits ) { 00342 $wgHiddenPrefs[] = 'enotifminoredits'; 00343 } 00344 00345 if ( $wgMetaNamespace === false ) { 00346 $wgMetaNamespace = str_replace( ' ', '_', $wgSitename ); 00347 } 00348 00349 // Default value is either the suhosin limit or -1 for unlimited 00350 if ( $wgResourceLoaderMaxQueryLength === false ) { 00351 $maxValueLength = ini_get( 'suhosin.get.max_value_length' ); 00352 $wgResourceLoaderMaxQueryLength = $maxValueLength > 0 ? $maxValueLength : -1; 00353 } 00354 00359 $wgCanonicalNamespaceNames = array( 00360 NS_MEDIA => 'Media', 00361 NS_SPECIAL => 'Special', 00362 NS_TALK => 'Talk', 00363 NS_USER => 'User', 00364 NS_USER_TALK => 'User_talk', 00365 NS_PROJECT => 'Project', 00366 NS_PROJECT_TALK => 'Project_talk', 00367 NS_FILE => 'File', 00368 NS_FILE_TALK => 'File_talk', 00369 NS_MEDIAWIKI => 'MediaWiki', 00370 NS_MEDIAWIKI_TALK => 'MediaWiki_talk', 00371 NS_TEMPLATE => 'Template', 00372 NS_TEMPLATE_TALK => 'Template_talk', 00373 NS_HELP => 'Help', 00374 NS_HELP_TALK => 'Help_talk', 00375 NS_CATEGORY => 'Category', 00376 NS_CATEGORY_TALK => 'Category_talk', 00377 ); 00378 00380 if ( is_array( $wgExtraNamespaces ) ) { 00381 $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces; 00382 } 00383 00384 // These are now the same, always 00385 // To determine the user language, use $wgLang->getCode() 00386 $wgContLanguageCode = $wgLanguageCode; 00387 00388 // Easy to forget to falsify $wgShowIPinHeader for static caches. 00389 // If file cache or squid cache is on, just disable this (DWIMD). 00390 // Do the same for $wgDebugToolbar. 00391 if ( $wgUseFileCache || $wgUseSquid ) { 00392 $wgShowIPinHeader = false; 00393 $wgDebugToolbar = false; 00394 } 00395 00396 // We always output HTML5 since 1.22, overriding these is no longer supported 00397 // we set them here for extensions that depend on its value. 00398 $wgHtml5 = true; 00399 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml'; 00400 $wgJsMimeType = 'text/javascript'; 00401 00402 if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) { 00403 // see http://www.w3.org/TR/rdfa-in-html/#document-conformance 00404 if ( $wgMimeType == 'application/xhtml+xml' ) { 00405 $wgHtml5Version = 'XHTML+RDFa 1.0'; 00406 } else { 00407 $wgHtml5Version = 'HTML+RDFa 1.0'; 00408 } 00409 } 00410 00411 // Blacklisted file extensions shouldn't appear on the "allowed" list 00412 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) ); 00413 00414 if ( $wgInvalidateCacheOnLocalSettingsChange ) { 00415 // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged - No GlobalFunction here yet. 00416 $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) ); 00417 // @codingStandardsIgnoreEnd 00418 } 00419 00420 if ( $wgNewUserLog ) { 00421 // Add a new log type 00422 $wgLogTypes[] = 'newusers'; 00423 $wgLogNames['newusers'] = 'newuserlogpage'; 00424 $wgLogHeaders['newusers'] = 'newuserlogpagetext'; 00425 $wgLogActionsHandlers['newusers/newusers'] = 'NewUsersLogFormatter'; 00426 $wgLogActionsHandlers['newusers/create'] = 'NewUsersLogFormatter'; 00427 $wgLogActionsHandlers['newusers/create2'] = 'NewUsersLogFormatter'; 00428 $wgLogActionsHandlers['newusers/byemail'] = 'NewUsersLogFormatter'; 00429 $wgLogActionsHandlers['newusers/autocreate'] = 'NewUsersLogFormatter'; 00430 } 00431 00432 if ( $wgPageLanguageUseDB ) { 00433 $wgLogTypes[] = 'pagelang'; 00434 $wgLogActionsHandlers['pagelang/pagelang'] = 'PageLangLogFormatter'; 00435 } 00436 00437 if ( $wgCookieSecure === 'detect' ) { 00438 $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' ); 00439 } 00440 00441 // Back compatibility for $wgRateLimitLog deprecated with 1.23 00442 if ( $wgRateLimitLog && !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) { 00443 $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog; 00444 } 00445 00446 if ( $wgProfileOnly ) { 00447 $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile; 00448 $wgDebugLogFile = ''; 00449 } 00450 00451 wfProfileOut( $fname . '-defaults' ); 00452 00453 // Disable MWDebug for command line mode, this prevents MWDebug from eating up 00454 // all the memory from logging SQL queries on maintenance scripts 00455 global $wgCommandLineMode; 00456 if ( $wgDebugToolbar && !$wgCommandLineMode ) { 00457 wfProfileIn( $fname . '-debugtoolbar' ); 00458 MWDebug::init(); 00459 wfProfileOut( $fname . '-debugtoolbar' ); 00460 } 00461 00462 if ( !class_exists( 'AutoLoader' ) ) { 00463 require_once "$IP/includes/AutoLoader.php"; 00464 } 00465 00466 wfProfileIn( $fname . '-exception' ); 00467 MWExceptionHandler::installHandler(); 00468 wfProfileOut( $fname . '-exception' ); 00469 00470 wfProfileIn( $fname . '-includes' ); 00471 require_once "$IP/includes/normal/UtfNormalUtil.php"; 00472 require_once "$IP/includes/GlobalFunctions.php"; 00473 require_once "$IP/includes/normal/UtfNormalDefines.php"; 00474 wfProfileOut( $fname . '-includes' ); 00475 00476 wfProfileIn( $fname . '-defaults2' ); 00477 00478 if ( $wgCanonicalServer === false ) { 00479 $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP ); 00480 } 00481 00482 // Set server name 00483 $serverParts = wfParseUrl( $wgCanonicalServer ); 00484 if ( $wgServerName !== false ) { 00485 wfWarn( '$wgServerName should be derived from $wgCanonicalServer, ' 00486 . 'not customized. Overwriting $wgServerName.' ); 00487 } 00488 $wgServerName = $serverParts['host']; 00489 unset( $serverParts ); 00490 00491 // Set defaults for configuration variables 00492 // that are derived from the server name by default 00493 if ( $wgEmergencyContact === false ) { 00494 $wgEmergencyContact = 'wikiadmin@' . $wgServerName; 00495 } 00496 00497 if ( $wgPasswordSender === false ) { 00498 $wgPasswordSender = 'apache@' . $wgServerName; 00499 } 00500 00501 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) { 00502 $wgSecureLogin = false; 00503 wfWarn( 'Secure login was enabled on a server that only supports ' 00504 . 'HTTP or HTTPS. Disabling secure login.' ); 00505 } 00506 00507 // Now that GlobalFunctions is loaded, set defaults that depend 00508 // on it. 00509 if ( $wgTmpDirectory === false ) { 00510 wfProfileIn( $fname . '-tempDir' ); 00511 $wgTmpDirectory = wfTempDir(); 00512 wfProfileOut( $fname . '-tempDir' ); 00513 } 00514 00515 wfProfileOut( $fname . '-defaults2' ); 00516 wfProfileIn( $fname . '-misc1' ); 00517 00518 // Raise the memory limit if it's too low 00519 wfMemoryLimit(); 00520 00526 if ( is_null( $wgLocaltimezone ) ) { 00527 wfSuppressWarnings(); 00528 $wgLocaltimezone = date_default_timezone_get(); 00529 wfRestoreWarnings(); 00530 } 00531 00532 date_default_timezone_set( $wgLocaltimezone ); 00533 if ( is_null( $wgLocalTZoffset ) ) { 00534 $wgLocalTZoffset = date( 'Z' ) / 60; 00535 } 00536 00537 // Useful debug output 00538 if ( $wgCommandLineMode ) { 00539 $wgRequest = new FauxRequest( array() ); 00540 00541 wfDebug( "\n\nStart command line script $self\n" ); 00542 } else { 00543 // Can't stub this one, it sets up $_GET and $_REQUEST in its constructor 00544 $wgRequest = new WebRequest; 00545 00546 $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n"; 00547 00548 if ( $wgDebugPrintHttpHeaders ) { 00549 $debug .= "HTTP HEADERS:\n"; 00550 00551 foreach ( $wgRequest->getAllHeaders() as $name => $value ) { 00552 $debug .= "$name: $value\n"; 00553 } 00554 } 00555 wfDebug( $debug ); 00556 } 00557 00558 wfProfileOut( $fname . '-misc1' ); 00559 wfProfileIn( $fname . '-memcached' ); 00560 00561 $wgMemc = wfGetMainCache(); 00562 $messageMemc = wfGetMessageCacheStorage(); 00563 $parserMemc = wfGetParserCacheStorage(); 00564 $wgLangConvMemc = wfGetLangConverterCacheStorage(); 00565 00566 wfDebugLog( 'caches', 'main: ' . get_class( $wgMemc ) . 00567 ', message: ' . get_class( $messageMemc ) . 00568 ', parser: ' . get_class( $parserMemc ) ); 00569 00570 wfProfileOut( $fname . '-memcached' ); 00571 00572 // Most of the config is out, some might want to run hooks here. 00573 wfRunHooks( 'SetupAfterCache' ); 00574 00575 wfProfileIn( $fname . '-session' ); 00576 00577 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { 00578 // If session.auto_start is there, we can't touch session name 00579 if ( !wfIniGetBool( 'session.auto_start' ) ) { 00580 session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' ); 00581 } 00582 00583 if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) { 00584 wfSetupSession(); 00585 } 00586 } 00587 00588 wfProfileOut( $fname . '-session' ); 00589 wfProfileIn( $fname . '-globals' ); 00590 00594 $wgContLang = Language::factory( $wgLanguageCode ); 00595 $wgContLang->initEncoding(); 00596 $wgContLang->initContLang(); 00597 00598 // Now that variant lists may be available... 00599 $wgRequest->interpolateTitle(); 00600 00604 $wgUser = RequestContext::getMain()->getUser(); // BackCompat 00605 00609 $wgLang = new StubUserLang; 00610 00614 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat 00615 00619 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); 00620 00621 if ( !is_object( $wgAuth ) ) { 00622 $wgAuth = new AuthPlugin; 00623 wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) ); 00624 } 00625 00629 $wgTitle = null; 00630 00635 $wgDeferredUpdateList = array(); 00636 00637 wfProfileOut( $fname . '-globals' ); 00638 wfProfileIn( $fname . '-extensions' ); 00639 00640 // Extension setup functions for extensions other than skins 00641 // Entries should be added to this variable during the inclusion 00642 // of the extension file. This allows the extension to perform 00643 // any necessary initialisation in the fully initialised environment 00644 foreach ( $wgExtensionFunctions as $func ) { 00645 // Allow closures in PHP 5.3+ 00646 if ( is_object( $func ) && $func instanceof Closure ) { 00647 $profName = $fname . '-extensions-closure'; 00648 } elseif ( is_array( $func ) ) { 00649 if ( is_object( $func[0] ) ) { 00650 $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1]; 00651 } else { 00652 $profName = $fname . '-extensions-' . implode( '::', $func ); 00653 } 00654 } else { 00655 $profName = $fname . '-extensions-' . strval( $func ); 00656 } 00657 00658 wfProfileIn( $profName ); 00659 call_user_func( $func ); 00660 wfProfileOut( $profName ); 00661 } 00662 00663 wfDebug( "Fully initialised\n" ); 00664 $wgFullyInitialised = true; 00665 00666 wfProfileOut( $fname . '-extensions' ); 00667 wfProfileOut( $fname );