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