Merge "Avoid "Transaction already in progress" errors in SiteStatsUpdate::doUpdate"
[lhc/web/wiklou.git] / includes / Setup.php
1 <?php
2 /**
3 * Include most things that's need to customize the site.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 */
22
23 /**
24 * This file is not a valid entry point, perform no further processing unless
25 * MEDIAWIKI is defined
26 */
27 if ( !defined( 'MEDIAWIKI' ) ) {
28 exit( 1 );
29 }
30
31 # The main wiki script and things like database
32 # conversion and maintenance scripts all share a
33 # common setup of including lots of classes and
34 # setting up a few globals.
35 #
36
37 $fname = 'Setup.php';
38 wfProfileIn( $fname );
39
40 // Check to see if we are at the file scope
41 if ( !isset( $wgVersion ) ) {
42 echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
43 die( 1 );
44 }
45
46 // Set various default paths sensibly...
47 if ( $wgScript === false ) {
48 $wgScript = "$wgScriptPath/index$wgScriptExtension";
49 }
50 if ( $wgLoadScript === false ) {
51 $wgLoadScript = "$wgScriptPath/load$wgScriptExtension";
52 }
53
54 if ( $wgArticlePath === false ) {
55 if ( $wgUsePathInfo ) {
56 $wgArticlePath = "$wgScript/$1";
57 } else {
58 $wgArticlePath = "$wgScript?title=$1";
59 }
60 }
61
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;
66 }
67
68 if ( $wgStylePath === false ) {
69 $wgStylePath = "$wgScriptPath/skins";
70 }
71 if ( $wgLocalStylePath === false ) {
72 $wgLocalStylePath = "$wgScriptPath/skins";
73 }
74 if ( $wgStyleDirectory === false ) {
75 $wgStyleDirectory = "$IP/skins";
76 }
77 if ( $wgExtensionAssetsPath === false ) {
78 $wgExtensionAssetsPath = "$wgScriptPath/extensions";
79 }
80
81 if ( $wgLogo === false ) {
82 $wgLogo = "$wgStylePath/common/images/wiki.png";
83 }
84
85 if ( $wgUploadPath === false ) {
86 $wgUploadPath = "$wgScriptPath/images";
87 }
88 if ( $wgUploadDirectory === false ) {
89 $wgUploadDirectory = "$IP/images";
90 }
91 if ( $wgReadOnlyFile === false ) {
92 $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
93 }
94 if ( $wgFileCacheDirectory === false ) {
95 $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
96 }
97 if ( $wgDeletedDirectory === false ) {
98 $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
99 }
100
101 if ( isset( $wgFileStore['deleted']['directory'] ) ) {
102 $wgDeletedDirectory = $wgFileStore['deleted']['directory'];
103 }
104
105 if ( isset( $wgFooterIcons['copyright'] ) &&
106 isset( $wgFooterIcons['copyright']['copyright'] ) &&
107 $wgFooterIcons['copyright']['copyright'] === array() )
108 {
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,
116 );
117 } else {
118 unset( $wgFooterIcons['copyright']['copyright'] );
119 }
120 }
121
122 if ( isset( $wgFooterIcons['poweredby'] ) &&
123 isset( $wgFooterIcons['poweredby']['mediawiki'] ) &&
124 $wgFooterIcons['poweredby']['mediawiki']['src'] === null )
125 {
126 $wgFooterIcons['poweredby']['mediawiki']['src'] = "$wgStylePath/common/images/poweredby_mediawiki_88x31.png";
127 }
128
129 /**
130 * Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a
131 * sysadmin to set $wgNamespaceProtection incorrectly and leave the wiki insecure.
132 *
133 * Note that this is the definition of editinterface and it can be granted to
134 * all users if desired.
135 */
136 $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface';
137
138 /**
139 * The canonical names of namespaces 6 and 7 are, as of v1.14, "File"
140 * and "File_talk". The old names "Image" and "Image_talk" are
141 * retained as aliases for backwards compatibility.
142 */
143 $wgNamespaceAliases['Image'] = NS_FILE;
144 $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
145
146 /**
147 * Initialise $wgLockManagers to include basic FS version
148 */
149 $wgLockManagers[] = array(
150 'name' => 'fsLockManager',
151 'class' => 'FSLockManager',
152 'lockDirectory' => "{$wgUploadDirectory}/lockdir",
153 );
154 $wgLockManagers[] = array(
155 'name' => 'nullLockManager',
156 'class' => 'NullLockManager',
157 );
158
159 /**
160 * Initialise $wgLocalFileRepo from backwards-compatible settings
161 */
162 if ( !$wgLocalFileRepo ) {
163 if ( isset( $wgFileStore['deleted']['hash'] ) ) {
164 $deletedHashLevel = $wgFileStore['deleted']['hash'];
165 } else {
166 $deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0;
167 }
168 $wgLocalFileRepo = array(
169 'class' => 'LocalRepo',
170 'name' => 'local',
171 'directory' => $wgUploadDirectory,
172 'scriptDirUrl' => $wgScriptPath,
173 'scriptExtension' => $wgScriptExtension,
174 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
175 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
176 'thumbScriptUrl' => $wgThumbnailScriptPath,
177 'transformVia404' => !$wgGenerateThumbnailOnParse,
178 'deletedDir' => $wgDeletedDirectory,
179 'deletedHashLevels' => $deletedHashLevel
180 );
181 }
182 /**
183 * Initialise shared repo from backwards-compatible settings
184 */
185 if ( $wgUseSharedUploads ) {
186 if ( $wgSharedUploadDBname ) {
187 $wgForeignFileRepos[] = array(
188 'class' => 'ForeignDBRepo',
189 'name' => 'shared',
190 'directory' => $wgSharedUploadDirectory,
191 'url' => $wgSharedUploadPath,
192 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
193 'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
194 'transformVia404' => !$wgGenerateThumbnailOnParse,
195 'dbType' => $wgDBtype,
196 'dbServer' => $wgDBserver,
197 'dbUser' => $wgDBuser,
198 'dbPassword' => $wgDBpassword,
199 'dbName' => $wgSharedUploadDBname,
200 'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
201 'tablePrefix' => $wgSharedUploadDBprefix,
202 'hasSharedCache' => $wgCacheSharedUploads,
203 'descBaseUrl' => $wgRepositoryBaseUrl,
204 'fetchDescription' => $wgFetchCommonsDescriptions,
205 );
206 } else {
207 $wgForeignFileRepos[] = array(
208 'class' => 'FileRepo',
209 'name' => 'shared',
210 'directory' => $wgSharedUploadDirectory,
211 'url' => $wgSharedUploadPath,
212 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
213 'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
214 'transformVia404' => !$wgGenerateThumbnailOnParse,
215 'descBaseUrl' => $wgRepositoryBaseUrl,
216 'fetchDescription' => $wgFetchCommonsDescriptions,
217 );
218 }
219 }
220 if ( $wgUseInstantCommons ) {
221 $wgForeignFileRepos[] = array(
222 'class' => 'ForeignAPIRepo',
223 'name' => 'wikimediacommons',
224 'apibase' => WebRequest::detectProtocol() === 'https' ?
225 'https://commons.wikimedia.org/w/api.php' :
226 'http://commons.wikimedia.org/w/api.php',
227 'hashLevels' => 2,
228 'fetchDescription' => true,
229 'descriptionCacheExpiry' => 43200,
230 'apiThumbCacheExpiry' => 86400,
231 );
232 }
233 /*
234 * Add on default file backend config for file repos.
235 * FileBackendGroup will handle initializing the backends.
236 */
237 if ( !isset( $wgLocalFileRepo['backend'] ) ) {
238 $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
239 }
240 foreach ( $wgForeignFileRepos as &$repo ) {
241 if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) {
242 $repo['directory'] = $wgUploadDirectory; // b/c
243 }
244 if ( !isset( $repo['backend'] ) ) {
245 $repo['backend'] = $repo['name'] . '-backend';
246 }
247 }
248 unset( $repo ); // no global pollution; destroy reference
249
250 if ( is_null( $wgEnableAutoRotation ) ) {
251 // Only enable auto-rotation when the bitmap handler can rotate
252 $wgEnableAutoRotation = BitmapHandler::canRotate();
253 }
254
255 if ( $wgRCFilterByAge ) {
256 # # Trim down $wgRCLinkDays so that it only lists links which are valid
257 # # as determined by $wgRCMaxAge.
258 # # Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
259 sort( $wgRCLinkDays );
260 for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
261 if ( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) {
262 $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
263 break;
264 }
265 }
266 }
267
268 if ( $wgSkipSkin ) {
269 $wgSkipSkins[] = $wgSkipSkin;
270 }
271
272 # Set default shared prefix
273 if ( $wgSharedPrefix === false ) {
274 $wgSharedPrefix = $wgDBprefix;
275 }
276
277 if ( !$wgCookiePrefix ) {
278 if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
279 $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
280 } elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
281 $wgCookiePrefix = $wgSharedDB;
282 } elseif ( $wgDBprefix ) {
283 $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
284 } else {
285 $wgCookiePrefix = $wgDBname;
286 }
287 }
288 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
289
290 $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
291
292 if ( $wgMetaNamespace === false ) {
293 $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
294 }
295
296
297 // Default value is either the suhosin limit or -1 for unlimited
298 if ( $wgResourceLoaderMaxQueryLength === false ) {
299 $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
300 $wgResourceLoaderMaxQueryLength = $maxValueLength > 0 ? $maxValueLength : -1;
301 }
302
303 /**
304 * Definitions of the NS_ constants are in Defines.php
305 * @private
306 */
307 $wgCanonicalNamespaceNames = array(
308 NS_MEDIA => 'Media',
309 NS_SPECIAL => 'Special',
310 NS_TALK => 'Talk',
311 NS_USER => 'User',
312 NS_USER_TALK => 'User_talk',
313 NS_PROJECT => 'Project',
314 NS_PROJECT_TALK => 'Project_talk',
315 NS_FILE => 'File',
316 NS_FILE_TALK => 'File_talk',
317 NS_MEDIAWIKI => 'MediaWiki',
318 NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
319 NS_TEMPLATE => 'Template',
320 NS_TEMPLATE_TALK => 'Template_talk',
321 NS_HELP => 'Help',
322 NS_HELP_TALK => 'Help_talk',
323 NS_CATEGORY => 'Category',
324 NS_CATEGORY_TALK => 'Category_talk',
325 );
326
327 /// @todo UGLY UGLY
328 if ( is_array( $wgExtraNamespaces ) ) {
329 $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces;
330 }
331
332 # These are now the same, always
333 # To determine the user language, use $wgLang->getCode()
334 $wgContLanguageCode = $wgLanguageCode;
335
336 # Easy to forget to falsify $wgShowIPinHeader for static caches.
337 # If file cache or squid cache is on, just disable this (DWIMD).
338 # Do the same for $wgDebugToolbar.
339 if ( $wgUseFileCache || $wgUseSquid ) {
340 $wgShowIPinHeader = false;
341 $wgDebugToolbar = false;
342 }
343
344 # Doesn't make sense to have if disabled.
345 if ( !$wgEnotifMinorEdits ) {
346 $wgHiddenPrefs[] = 'enotifminoredits';
347 }
348
349 # $wgDisabledActions is deprecated as of 1.18
350 foreach ( $wgDisabledActions as $action ) {
351 $wgActions[$action] = false;
352 }
353
354 # We always output HTML5 since 1.22, overriding these is no longer supported
355 # we set them here for extensions that depend on its value.
356 $wgHtml5 = true;
357 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
358 $wgJsMimeType = 'text/javascript';
359
360 if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
361 # see http://www.w3.org/TR/rdfa-in-html/#document-conformance
362 if ( $wgMimeType == 'application/xhtml+xml' ) {
363 $wgHtml5Version = 'XHTML+RDFa 1.0';
364 } else {
365 $wgHtml5Version = 'HTML+RDFa 1.0';
366 }
367 }
368
369 # Blacklisted file extensions shouldn't appear on the "allowed" list
370 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) );
371
372 if ( $wgArticleCountMethod === null ) {
373 $wgArticleCountMethod = $wgUseCommaCount ? 'comma' : 'link';
374 }
375
376 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
377 $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
378 }
379
380 if ( $wgNewUserLog ) {
381 # Add a new log type
382 $wgLogTypes[] = 'newusers';
383 $wgLogNames['newusers'] = 'newuserlogpage';
384 $wgLogHeaders['newusers'] = 'newuserlogpagetext';
385 $wgLogActionsHandlers['newusers/newusers'] = 'NewUsersLogFormatter';
386 $wgLogActionsHandlers['newusers/create'] = 'NewUsersLogFormatter';
387 $wgLogActionsHandlers['newusers/create2'] = 'NewUsersLogFormatter';
388 $wgLogActionsHandlers['newusers/byemail'] = 'NewUsersLogFormatter';
389 $wgLogActionsHandlers['newusers/autocreate'] = 'NewUsersLogFormatter';
390 }
391
392 if ( $wgCookieSecure === 'detect' ) {
393 $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
394 }
395
396 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
397 // all the memory from logging SQL queries on maintenance scripts
398 global $wgCommandLineMode;
399 if ( $wgDebugToolbar && !$wgCommandLineMode ) {
400 MWDebug::init();
401 }
402
403 if ( !class_exists( 'AutoLoader' ) ) {
404 require_once "$IP/includes/AutoLoader.php";
405 }
406
407 wfProfileIn( $fname . '-exception' );
408 MWExceptionHandler::installHandler();
409 wfProfileOut( $fname . '-exception' );
410
411 wfProfileIn( $fname . '-includes' );
412 require_once "$IP/includes/normal/UtfNormalUtil.php";
413 require_once "$IP/includes/GlobalFunctions.php";
414 require_once "$IP/includes/ProxyTools.php";
415 require_once "$IP/includes/normal/UtfNormalDefines.php";
416 wfProfileOut( $fname . '-includes' );
417
418 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
419 $wgSecureLogin = false;
420 wfWarn( 'Secure login was enabled on a server that only supports HTTP or HTTPS. Disabling secure login.' );
421 }
422
423 # Now that GlobalFunctions is loaded, set defaults that depend
424 # on it.
425 if ( $wgTmpDirectory === false ) {
426 $wgTmpDirectory = wfTempDir();
427 }
428
429 if ( $wgCanonicalServer === false ) {
430 $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
431 }
432
433 // $wgHTCPMulticastRouting got renamed to $wgHTCPRouting in MediaWiki 1.22
434 // ensure back compatibility.
435 if ( !$wgHTCPRouting && $wgHTCPMulticastRouting ) {
436 $wgHTCPRouting = $wgHTCPMulticastRouting;
437 }
438
439 // Initialize $wgHTCPRouting from backwards-compatible settings that
440 // comes from pre 1.20 version.
441 if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
442 $wgHTCPRouting = array(
443 '' => array(
444 'host' => $wgHTCPMulticastAddress,
445 'port' => $wgHTCPPort,
446 )
447 );
448 }
449
450 wfProfileIn( $fname . '-misc1' );
451
452 # Raise the memory limit if it's too low
453 wfMemoryLimit();
454
455 /**
456 * Set up the timezone, suppressing the pseudo-security warning in PHP 5.1+
457 * that happens whenever you use a date function without the timezone being
458 * explicitly set. Inspired by phpMyAdmin's treatment of the problem.
459 */
460 if ( is_null( $wgLocaltimezone ) ) {
461 wfSuppressWarnings();
462 $wgLocaltimezone = date_default_timezone_get();
463 wfRestoreWarnings();
464 }
465
466 date_default_timezone_set( $wgLocaltimezone );
467 if ( is_null( $wgLocalTZoffset ) ) {
468 $wgLocalTZoffset = date( 'Z' ) / 60;
469 }
470
471 # Useful debug output
472 if ( $wgCommandLineMode ) {
473 $wgRequest = new FauxRequest( array() );
474
475 wfDebug( "\n\nStart command line script $self\n" );
476 } else {
477 # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
478 $wgRequest = new WebRequest;
479
480 $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
481
482 if ( $wgDebugPrintHttpHeaders ) {
483 $debug .= "HTTP HEADERS:\n";
484
485 foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
486 $debug .= "$name: $value\n";
487 }
488 }
489 wfDebug( $debug );
490 }
491
492 wfProfileOut( $fname . '-misc1' );
493 wfProfileIn( $fname . '-memcached' );
494
495 $wgMemc = wfGetMainCache();
496 $messageMemc = wfGetMessageCacheStorage();
497 $parserMemc = wfGetParserCacheStorage();
498 $wgLangConvMemc = wfGetLangConverterCacheStorage();
499
500 wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' .
501 get_class( $messageMemc ) . '[message] ' .
502 get_class( $parserMemc ) . "[parser]\n" );
503
504 wfProfileOut( $fname . '-memcached' );
505
506 # # Most of the config is out, some might want to run hooks here.
507 wfRunHooks( 'SetupAfterCache' );
508
509 wfProfileIn( $fname . '-session' );
510
511 # If session.auto_start is there, we can't touch session name
512 if ( !wfIniGetBool( 'session.auto_start' ) ) {
513 session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
514 }
515
516 if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
517 if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
518 wfSetupSession();
519 $wgSessionStarted = true;
520 } else {
521 $wgSessionStarted = false;
522 }
523 }
524
525 wfProfileOut( $fname . '-session' );
526 wfProfileIn( $fname . '-globals' );
527
528 $wgContLang = Language::factory( $wgLanguageCode );
529 $wgContLang->initEncoding();
530 $wgContLang->initContLang();
531
532 // Now that variant lists may be available...
533 $wgRequest->interpolateTitle();
534 $wgUser = RequestContext::getMain()->getUser(); # BackCompat
535
536 /**
537 * @var $wgLang Language
538 */
539 $wgLang = new StubUserLang;
540
541 /**
542 * @var OutputPage
543 */
544 $wgOut = RequestContext::getMain()->getOutput(); # BackCompat
545
546 /**
547 * @var $wgParser Parser
548 */
549 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
550
551 if ( !is_object( $wgAuth ) ) {
552 $wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' );
553 wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
554 }
555
556 # Placeholders in case of DB error
557 $wgTitle = null;
558
559 $wgDeferredUpdateList = array();
560
561 wfProfileOut( $fname . '-globals' );
562 wfProfileIn( $fname . '-extensions' );
563
564 # Extension setup functions for extensions other than skins
565 # Entries should be added to this variable during the inclusion
566 # of the extension file. This allows the extension to perform
567 # any necessary initialisation in the fully initialised environment
568 foreach ( $wgExtensionFunctions as $func ) {
569 # Allow closures in PHP 5.3+
570 if ( is_object( $func ) && $func instanceof Closure ) {
571 $profName = $fname . '-extensions-closure';
572 } elseif ( is_array( $func ) ) {
573 if ( is_object( $func[0] ) ) {
574 $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
575 } else {
576 $profName = $fname . '-extensions-' . implode( '::', $func );
577 }
578 } else {
579 $profName = $fname . '-extensions-' . strval( $func );
580 }
581
582 wfProfileIn( $profName );
583 call_user_func( $func );
584 wfProfileOut( $profName );
585 }
586
587 wfDebug( "Fully initialised\n" );
588 $wgFullyInitialised = true;
589
590 wfProfileOut( $fname . '-extensions' );
591 wfProfileOut( $fname );