Add a Antispam group to Special:Version... we have a lot of these kind of extensions...
[mediawiki.git] / includes / ProfilerStub.php
blobe624e6f019b083d5f1beed75868c9c0c74350298
1 <?php
2 /**
3 * Stub profiling functions
4 * @file
5 * @ingroup Profiler
6 */
8 /** backward compatibility */
9 $wgProfiling = false;
10 $wgProfiler = null;
12 /** is setproctitle function available ? */
13 $haveProctitle = function_exists( 'setproctitle' );
15 /**
16 * Begin profiling of a function
17 * @param $fn string
19 function wfProfileIn( $fn = '' ) {
20 global $hackwhere, $wgDBname, $haveProctitle;
21 if( $haveProctitle ){
22 $hackwhere[] = $fn;
23 setproctitle( $fn . " [$wgDBname]" );
27 /**
28 * Stop profiling of a function
29 * @param $fn string
31 function wfProfileOut( $fn = '' ) {
32 global $hackwhere, $wgDBname, $haveProctitle;
33 if( !$haveProctitle ) {
34 return;
36 if( count( $hackwhere ) ) {
37 array_pop( $hackwhere );
39 if( count( $hackwhere ) ) {
40 setproctitle( $hackwhere[count( $hackwhere )-1] . " [$wgDBname]" );
44 /**
45 * Does nothing, just for compatibility
47 function wfGetProfilingOutput( $s, $e ) {}
49 /**
50 * Does nothing, just for compatibility
52 function wfProfileClose() {}