allow pre-started Profiler
authorDomas Mituzas <midom@users.mediawiki.org>
Tue, 3 Jan 2006 10:31:13 +0000 (10:31 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Tue, 3 Jan 2006 10:31:13 +0000 (10:31 +0000)
includes/ProfilerSimple.php
includes/Setup.php

index 9269df5..d96a755 100755 (executable)
@@ -8,6 +8,8 @@
  * @todo document
  * @package MediaWiki
  */
+require_once('Profiling.php');
+
 class ProfilerSimple extends Profiler {
        function ProfilerSimple() {
                global $wgRequestTime,$wgRUstart;
index 1fdc3f8..75f830f 100644 (file)
@@ -24,8 +24,11 @@ if ( !isset( $wgVersion ) ) {
 if( !isset( $wgProfiling ) )
        $wgProfiling = false;
 
-if ( $wgProfiling and (0 == rand() % $wgProfileSampleRate ) ) {
+if ( is_object($wgProfiler) ) {
+       /* nada, everything should be done already */
+} elseif ( $wgProfiling and (0 == rand() % $wgProfileSampleRate ) ) {
        require_once( 'Profiling.php' );
+       $wgProfiling = true;
        if ($wgProfilerType == "") {
                $wgProfiler = new Profiler();
        } else {