From: Tim Starling Date: Wed, 4 Jan 2006 23:17:35 +0000 (+0000) Subject: Moved stub profiling functions to their own file X-Git-Tag: 1.6.0~770 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=837f8137ba0a9f41db37d142e3ef0ad4abbec288;p=lhc%2Fweb%2Fwiklou.git Moved stub profiling functions to their own file --- diff --git a/includes/ProfilerStub.php b/includes/ProfilerStub.php new file mode 100644 index 0000000000..86cc622e1f --- /dev/null +++ b/includes/ProfilerStub.php @@ -0,0 +1,22 @@ + diff --git a/includes/Setup.php b/includes/Setup.php index d371f625cf..a63cf3fe1b 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -24,7 +24,7 @@ if ( !isset( $wgVersion ) ) { if( !isset( $wgProfiling ) ) $wgProfiling = false; -if ( isset($wgProfiler) && is_object($wgProfiler) ) { +if ( function_exists( 'wfProfileIn' ) ) { /* nada, everything should be done already */ } elseif ( $wgProfiling and (0 == rand() % $wgProfileSampleRate ) ) { require_once( 'Profiling.php' ); @@ -37,26 +37,7 @@ if ( isset($wgProfiler) && is_object($wgProfiler) ) { $wgProfiler = new $prclass(); } } else { - if (!function_exists('wfProfileIn')) { - function wfProfileIn( $fn = '' ) { - global $hackwhere, $wgDBname; - $hackwhere[] = $fn; - if (function_exists("setproctitle")) - setproctitle($fn . " [$wgDBname]"); - } - } - if (!function_exists('wfProfileOut')) { - function wfProfileOut( $fn = '' ) { - global $hackwhere, $wgDBname; - if (count($hackwhere)) - array_pop($hackwhere); - if (function_exists("setproctitle") && count($hackwhere)) - setproctitle($hackwhere[count($hackwhere)-1] . " [$wgDBname]"); - } - } - function wfGetProfilingOutput( $s, $e ) {} - function wfProfileClose() {} - function wfLogProfilingData() {} + require_once( 'ProfilerStub.php' ); } $fname = 'Setup.php';