Adding messages for new global group 'sysadmin'. Brion, Tim, Kate and JeLuF are all...
[lhc/web/wiklou.git] / includes / ProfilerStub.php
1 <?php
2 /**
3 * Stub profiling functions
4 * @file
5 * @ingroup Profiler
6 */
7
8 /** backward compatibility */
9 $wgProfiling = false;
10
11 /** is setproctitle function available ? */
12 $haveProctitle = function_exists( 'setproctitle' );
13
14 /**
15 * Begin profiling of a function
16 * @param $fn string
17 */
18 function wfProfileIn( $fn = '' ) {
19 global $hackwhere, $wgDBname, $haveProctitle;
20 if( $haveProctitle ){
21 $hackwhere[] = $fn;
22 setproctitle( $fn . " [$wgDBname]" );
23 }
24 }
25
26 /**
27 * Stop profiling of a function
28 * @param $fn string
29 */
30 function wfProfileOut( $fn = '' ) {
31 global $hackwhere, $wgDBname, $haveProctitle;
32 if( !$haveProctitle )
33 return;
34 if( count( $hackwhere ) )
35 array_pop( $hackwhere );
36 if( count( $hackwhere ) )
37 setproctitle( $hackwhere[count( $hackwhere )-1] . " [$wgDBname]" );
38 }
39
40 /**
41 * Does nothing, just for compatibility
42 */
43 function wfGetProfilingOutput( $s, $e ) {}
44
45 /**
46 * Does nothing, just for compatibility
47 */
48 function wfProfileClose() {}