Move Modern and CologneBlue out of core
[mediawiki.git] / includes / Setup.php
bloba1bca22b72116d8ff576d063ae8bde6cac642978
1 <?php
2 /**
3 * Include most things that are needed to make %MediaWiki work.
5 * This file is included by WebStart.php and doMaintenance.php so that both
6 * web and maintenance scripts share a final set up phase to include necessary
7 * files and create global object variables.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
24 * @file
27 /**
28 * This file is not a valid entry point, perform no further processing unless
29 * MEDIAWIKI is defined
31 if ( !defined( 'MEDIAWIKI' ) ) {
32 exit( 1 );
35 $fname = 'Setup.php';
36 wfProfileIn( $fname );
37 wfProfileIn( $fname . '-defaults' );
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 );
45 // Set various default paths sensibly...
47 if ( $wgScript === false ) {
48 $wgScript = "$wgScriptPath/index$wgScriptExtension";
50 if ( $wgLoadScript === false ) {
51 $wgLoadScript = "$wgScriptPath/load$wgScriptExtension";
54 if ( $wgArticlePath === false ) {
55 if ( $wgUsePathInfo ) {
56 $wgArticlePath = "$wgScript/$1";
57 } else {
58 $wgArticlePath = "$wgScript?title=$1";
62 if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
63 // 'view' is assumed the default action path everywhere in the code
64 // but is rarely filled in $wgActionPaths
65 $wgActionPaths['view'] = $wgArticlePath;
68 if ( $wgStylePath === false ) {
69 $wgStylePath = "$wgScriptPath/skins";
71 if ( $wgLocalStylePath === false ) {
72 $wgLocalStylePath = "$wgScriptPath/skins";
74 if ( $wgStyleDirectory === false ) {
75 $wgStyleDirectory = "$IP/skins";
77 if ( $wgExtensionAssetsPath === false ) {
78 $wgExtensionAssetsPath = "$wgScriptPath/extensions";
81 if ( $wgLogo === false ) {
82 $wgLogo = "$wgStylePath/common/images/wiki.png";
85 if ( $wgUploadPath === false ) {
86 $wgUploadPath = "$wgScriptPath/images";
88 if ( $wgUploadDirectory === false ) {
89 $wgUploadDirectory = "$IP/images";
91 if ( $wgReadOnlyFile === false ) {
92 $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
94 if ( $wgFileCacheDirectory === false ) {
95 $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
97 if ( $wgDeletedDirectory === false ) {
98 $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
101 if ( isset( $wgFileStore['deleted']['directory'] ) ) {
102 $wgDeletedDirectory = $wgFileStore['deleted']['directory'];
105 if ( isset( $wgFooterIcons['copyright'] )
106 && isset( $wgFooterIcons['copyright']['copyright'] )
107 && $wgFooterIcons['copyright']['copyright'] === array()
109 if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
110 $wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon;
111 } elseif ( $wgRightsIcon || $wgRightsText ) {
112 $wgFooterIcons['copyright']['copyright'] = array(
113 'url' => $wgRightsUrl,
114 'src' => $wgRightsIcon,
115 'alt' => $wgRightsText,
117 } else {
118 unset( $wgFooterIcons['copyright']['copyright'] );
122 if ( isset( $wgFooterIcons['poweredby'] )
123 && isset( $wgFooterIcons['poweredby']['mediawiki'] )
124 && $wgFooterIcons['poweredby']['mediawiki']['src'] === null
126 $wgFooterIcons['poweredby']['mediawiki']['src'] =
127 "$wgStylePath/common/images/poweredby_mediawiki_88x31.png";
131 * Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a
132 * sysadmin to set $wgNamespaceProtection incorrectly and leave the wiki insecure.
134 * Note that this is the definition of editinterface and it can be granted to
135 * all users if desired.
137 $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface';
140 * The canonical names of namespaces 6 and 7 are, as of v1.14, "File"
141 * and "File_talk". The old names "Image" and "Image_talk" are
142 * retained as aliases for backwards compatibility.
144 $wgNamespaceAliases['Image'] = NS_FILE;
145 $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
148 * Initialise $wgLockManagers to include basic FS version
150 $wgLockManagers[] = array(
151 'name' => 'fsLockManager',
152 'class' => 'FSLockManager',
153 'lockDirectory' => "{$wgUploadDirectory}/lockdir",
155 $wgLockManagers[] = array(
156 'name' => 'nullLockManager',
157 'class' => 'NullLockManager',
161 * Initialise $wgLocalFileRepo from backwards-compatible settings
163 if ( !$wgLocalFileRepo ) {
164 if ( isset( $wgFileStore['deleted']['hash'] ) ) {
165 $deletedHashLevel = $wgFileStore['deleted']['hash'];
166 } else {
167 $deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0;
169 $wgLocalFileRepo = array(
170 'class' => 'LocalRepo',
171 'name' => 'local',
172 'directory' => $wgUploadDirectory,
173 'scriptDirUrl' => $wgScriptPath,
174 'scriptExtension' => $wgScriptExtension,
175 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
176 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
177 'thumbScriptUrl' => $wgThumbnailScriptPath,
178 'transformVia404' => !$wgGenerateThumbnailOnParse,
179 'deletedDir' => $wgDeletedDirectory,
180 'deletedHashLevels' => $deletedHashLevel
184 * Initialise shared repo from backwards-compatible settings
186 if ( $wgUseSharedUploads ) {
187 if ( $wgSharedUploadDBname ) {
188 $wgForeignFileRepos[] = array(
189 'class' => 'ForeignDBRepo',
190 'name' => 'shared',
191 'directory' => $wgSharedUploadDirectory,
192 'url' => $wgSharedUploadPath,
193 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
194 'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
195 'transformVia404' => !$wgGenerateThumbnailOnParse,
196 'dbType' => $wgDBtype,
197 'dbServer' => $wgDBserver,
198 'dbUser' => $wgDBuser,
199 'dbPassword' => $wgDBpassword,
200 'dbName' => $wgSharedUploadDBname,
201 'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
202 'tablePrefix' => $wgSharedUploadDBprefix,
203 'hasSharedCache' => $wgCacheSharedUploads,
204 'descBaseUrl' => $wgRepositoryBaseUrl,
205 'fetchDescription' => $wgFetchCommonsDescriptions,
207 } else {
208 $wgForeignFileRepos[] = array(
209 'class' => 'FileRepo',
210 'name' => 'shared',
211 'directory' => $wgSharedUploadDirectory,
212 'url' => $wgSharedUploadPath,
213 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
214 'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
215 'transformVia404' => !$wgGenerateThumbnailOnParse,
216 'descBaseUrl' => $wgRepositoryBaseUrl,
217 'fetchDescription' => $wgFetchCommonsDescriptions,
221 if ( $wgUseInstantCommons ) {
222 $wgForeignFileRepos[] = array(
223 'class' => 'ForeignAPIRepo',
224 'name' => 'wikimediacommons',
225 'apibase' => WebRequest::detectProtocol() === 'https' ?
226 'https://commons.wikimedia.org/w/api.php' :
227 'http://commons.wikimedia.org/w/api.php',
228 'hashLevels' => 2,
229 'fetchDescription' => true,
230 'descriptionCacheExpiry' => 43200,
231 'apiThumbCacheExpiry' => 86400,
235 * Add on default file backend config for file repos.
236 * FileBackendGroup will handle initializing the backends.
238 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
239 $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
241 foreach ( $wgForeignFileRepos as &$repo ) {
242 if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) {
243 $repo['directory'] = $wgUploadDirectory; // b/c
245 if ( !isset( $repo['backend'] ) ) {
246 $repo['backend'] = $repo['name'] . '-backend';
249 unset( $repo ); // no global pollution; destroy reference
251 if ( $wgRCFilterByAge ) {
252 // Trim down $wgRCLinkDays so that it only lists links which are valid
253 // as determined by $wgRCMaxAge.
254 // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
255 sort( $wgRCLinkDays );
257 // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
258 for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
259 // @codingStandardsIgnoreEnd
260 if ( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) {
261 $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
262 break;
267 if ( $wgSkipSkin ) {
268 $wgSkipSkins[] = $wgSkipSkin;
271 if ( $wgLocalInterwiki ) {
272 array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
275 // Set default shared prefix
276 if ( $wgSharedPrefix === false ) {
277 $wgSharedPrefix = $wgDBprefix;
280 if ( !$wgCookiePrefix ) {
281 if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
282 $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
283 } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
284 $wgCookiePrefix = $wgSharedDB;
285 } elseif ( $wgDBprefix ) {
286 $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
287 } else {
288 $wgCookiePrefix = $wgDBname;
291 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
293 $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
295 if ( $wgMetaNamespace === false ) {
296 $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
299 // Default value is either the suhosin limit or -1 for unlimited
300 if ( $wgResourceLoaderMaxQueryLength === false ) {
301 $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
302 $wgResourceLoaderMaxQueryLength = $maxValueLength > 0 ? $maxValueLength : -1;
306 * Definitions of the NS_ constants are in Defines.php
307 * @private
309 $wgCanonicalNamespaceNames = array(
310 NS_MEDIA => 'Media',
311 NS_SPECIAL => 'Special',
312 NS_TALK => 'Talk',
313 NS_USER => 'User',
314 NS_USER_TALK => 'User_talk',
315 NS_PROJECT => 'Project',
316 NS_PROJECT_TALK => 'Project_talk',
317 NS_FILE => 'File',
318 NS_FILE_TALK => 'File_talk',
319 NS_MEDIAWIKI => 'MediaWiki',
320 NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
321 NS_TEMPLATE => 'Template',
322 NS_TEMPLATE_TALK => 'Template_talk',
323 NS_HELP => 'Help',
324 NS_HELP_TALK => 'Help_talk',
325 NS_CATEGORY => 'Category',
326 NS_CATEGORY_TALK => 'Category_talk',
329 /// @todo UGLY UGLY
330 if ( is_array( $wgExtraNamespaces ) ) {
331 $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces;
334 // These are now the same, always
335 // To determine the user language, use $wgLang->getCode()
336 $wgContLanguageCode = $wgLanguageCode;
338 // Easy to forget to falsify $wgShowIPinHeader for static caches.
339 // If file cache or squid cache is on, just disable this (DWIMD).
340 // Do the same for $wgDebugToolbar.
341 if ( $wgUseFileCache || $wgUseSquid ) {
342 $wgShowIPinHeader = false;
343 $wgDebugToolbar = false;
346 // Doesn't make sense to have if disabled.
347 if ( !$wgEnotifMinorEdits ) {
348 $wgHiddenPrefs[] = 'enotifminoredits';
351 // We always output HTML5 since 1.22, overriding these is no longer supported
352 // we set them here for extensions that depend on its value.
353 $wgHtml5 = true;
354 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
355 $wgJsMimeType = 'text/javascript';
357 if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
358 // see http://www.w3.org/TR/rdfa-in-html/#document-conformance
359 if ( $wgMimeType == 'application/xhtml+xml' ) {
360 $wgHtml5Version = 'XHTML+RDFa 1.0';
361 } else {
362 $wgHtml5Version = 'HTML+RDFa 1.0';
366 // Blacklisted file extensions shouldn't appear on the "allowed" list
367 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) );
369 if ( $wgArticleCountMethod === null ) {
370 $wgArticleCountMethod = $wgUseCommaCount ? 'comma' : 'link';
373 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
374 // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged - No GlobalFunction here yet.
375 $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
376 // @codingStandardsIgnoreEnd
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';
391 if ( $wgCookieSecure === 'detect' ) {
392 $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
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,
404 wfProfileOut( $fname . '-defaults' );
406 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
407 // all the memory from logging SQL queries on maintenance scripts
408 global $wgCommandLineMode;
409 if ( $wgDebugToolbar && !$wgCommandLineMode ) {
410 wfProfileIn( $fname . '-debugtoolbar' );
411 MWDebug::init();
412 wfProfileOut( $fname . '-debugtoolbar' );
415 if ( !class_exists( 'AutoLoader' ) ) {
416 require_once "$IP/includes/AutoLoader.php";
419 wfProfileIn( $fname . '-exception' );
420 MWExceptionHandler::installHandler();
421 wfProfileOut( $fname . '-exception' );
423 wfProfileIn( $fname . '-includes' );
424 require_once "$IP/includes/normal/UtfNormalUtil.php";
425 require_once "$IP/includes/GlobalFunctions.php";
426 require_once "$IP/includes/normal/UtfNormalDefines.php";
427 wfProfileOut( $fname . '-includes' );
429 wfProfileIn( $fname . '-defaults2' );
431 if ( $wgCanonicalServer === false ) {
432 $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
435 // Set server name
436 $serverParts = wfParseUrl( $wgCanonicalServer );
437 if ( $wgServerName !== false ) {
438 wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
439 . 'not customized. Overwriting $wgServerName.' );
441 $wgServerName = $serverParts['host'];
442 unset( $serverParts );
444 // Set defaults for configuration variables
445 // that are derived from the server name by default
446 if ( $wgEmergencyContact === false ) {
447 $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
450 if ( $wgPasswordSender === false ) {
451 $wgPasswordSender = 'apache@' . $wgServerName;
454 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
455 $wgSecureLogin = false;
456 wfWarn( 'Secure login was enabled on a server that only supports '
457 . 'HTTP or HTTPS. Disabling secure login.' );
460 // Now that GlobalFunctions is loaded, set defaults that depend
461 // on it.
462 if ( $wgTmpDirectory === false ) {
463 wfProfileIn( $fname . '-tempDir' );
464 $wgTmpDirectory = wfTempDir();
465 wfProfileOut( $fname . '-tempDir' );
468 // $wgHTCPMulticastRouting got renamed to $wgHTCPRouting in MediaWiki 1.22
469 // ensure back compatibility.
470 if ( !$wgHTCPRouting && $wgHTCPMulticastRouting ) {
471 $wgHTCPRouting = $wgHTCPMulticastRouting;
474 // Initialize $wgHTCPRouting from backwards-compatible settings that
475 // comes from pre 1.20 version.
476 if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
477 $wgHTCPRouting = array(
478 '' => array(
479 'host' => $wgHTCPMulticastAddress,
480 'port' => $wgHTCPPort,
485 // Back compatibility for $wgRateLimitLog deprecated with 1.23
486 if ( $wgRateLimitLog && ! array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
487 $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
490 if ( $wgProfileOnly ) {
491 $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
492 $wgDebugLogFile = '';
495 wfProfileOut( $fname . '-defaults2' );
496 wfProfileIn( $fname . '-misc1' );
498 // Raise the memory limit if it's too low
499 wfMemoryLimit();
502 * Set up the timezone, suppressing the pseudo-security warning in PHP 5.1+
503 * that happens whenever you use a date function without the timezone being
504 * explicitly set. Inspired by phpMyAdmin's treatment of the problem.
506 if ( is_null( $wgLocaltimezone ) ) {
507 wfSuppressWarnings();
508 $wgLocaltimezone = date_default_timezone_get();
509 wfRestoreWarnings();
512 date_default_timezone_set( $wgLocaltimezone );
513 if ( is_null( $wgLocalTZoffset ) ) {
514 $wgLocalTZoffset = date( 'Z' ) / 60;
517 // Useful debug output
518 if ( $wgCommandLineMode ) {
519 $wgRequest = new FauxRequest( array() );
521 wfDebug( "\n\nStart command line script $self\n" );
522 } else {
523 // Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
524 $wgRequest = new WebRequest;
526 $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
528 if ( $wgDebugPrintHttpHeaders ) {
529 $debug .= "HTTP HEADERS:\n";
531 foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
532 $debug .= "$name: $value\n";
535 wfDebug( $debug );
538 wfProfileOut( $fname . '-misc1' );
539 wfProfileIn( $fname . '-memcached' );
541 $wgMemc = wfGetMainCache();
542 $messageMemc = wfGetMessageCacheStorage();
543 $parserMemc = wfGetParserCacheStorage();
544 $wgLangConvMemc = wfGetLangConverterCacheStorage();
546 wfDebugLog( 'caches', 'main: ' . get_class( $wgMemc ) .
547 ', message: ' . get_class( $messageMemc ) .
548 ', parser: ' . get_class( $parserMemc ) );
550 wfProfileOut( $fname . '-memcached' );
552 // Most of the config is out, some might want to run hooks here.
553 wfRunHooks( 'SetupAfterCache' );
555 wfProfileIn( $fname . '-session' );
557 // If session.auto_start is there, we can't touch session name
558 if ( !wfIniGetBool( 'session.auto_start' ) ) {
559 session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
562 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode &&
563 ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) )
565 wfSetupSession();
568 wfProfileOut( $fname . '-session' );
569 wfProfileIn( $fname . '-globals' );
571 $wgContLang = Language::factory( $wgLanguageCode );
572 $wgContLang->initEncoding();
573 $wgContLang->initContLang();
575 // Now that variant lists may be available...
576 $wgRequest->interpolateTitle();
577 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
580 * @var $wgLang Language
582 $wgLang = new StubUserLang;
585 * @var OutputPage
587 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
590 * @var $wgParser Parser
592 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
594 if ( !is_object( $wgAuth ) ) {
595 $wgAuth = new AuthPlugin;
596 wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
599 # Placeholders in case of DB error
600 $wgTitle = null;
602 $wgDeferredUpdateList = array();
604 wfProfileOut( $fname . '-globals' );
605 wfProfileIn( $fname . '-extensions' );
607 // Extension setup functions for extensions other than skins
608 // Entries should be added to this variable during the inclusion
609 // of the extension file. This allows the extension to perform
610 // any necessary initialisation in the fully initialised environment
611 foreach ( $wgExtensionFunctions as $func ) {
612 // Allow closures in PHP 5.3+
613 if ( is_object( $func ) && $func instanceof Closure ) {
614 $profName = $fname . '-extensions-closure';
615 } elseif ( is_array( $func ) ) {
616 if ( is_object( $func[0] ) ) {
617 $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
618 } else {
619 $profName = $fname . '-extensions-' . implode( '::', $func );
621 } else {
622 $profName = $fname . '-extensions-' . strval( $func );
625 wfProfileIn( $profName );
626 call_user_func( $func );
627 wfProfileOut( $profName );
630 wfDebug( "Fully initialised\n" );
631 $wgFullyInitialised = true;
633 wfProfileOut( $fname . '-extensions' );
634 wfProfileOut( $fname );