--- /dev/null
+<?php
+
+# Stub profiling functions
+
+function wfProfileIn( $fn = '' ) {
+ global $hackwhere, $wgDBname;
+ $hackwhere[] = $fn;
+ if (function_exists("setproctitle"))
+ setproctitle($fn . " [$wgDBname]");
+}
+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() {}
+
+?>
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' );
$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';