Index: trunk/extensions/DumpHTML/dumpHTML.php |
— | — | @@ -44,8 +44,9 @@ |
45 | 45 | if ( $profiling ) { |
46 | 46 | define( 'MW_CMDLINE_CALLBACK', 'wfSetupDump' ); |
47 | 47 | function wfSetupDump() { |
48 | | - global $wgProfiling, $wgProfileToDatabase, $wgProfileSampleRate; |
49 | | - $wgProfiling = true; |
| 48 | + global $wgProfileToDatabase, $wgProfileSampleRate; |
| 49 | + // Override disabled profiling in maintenance scripts |
| 50 | + Profiler::setInstance( new Profiler() ); |
50 | 51 | $wgProfileToDatabase = false; |
51 | 52 | $wgProfileSampleRate = 1; |
52 | 53 | } |
— | — | @@ -171,7 +172,7 @@ |
172 | 173 | } |
173 | 174 | |
174 | 175 | if ( $profiling ) { |
175 | | - echo $wgProfiler->getOutput(); |
| 176 | + echo Profiler::instance()->getOutput(); |
176 | 177 | } |
177 | 178 | |
178 | 179 | |
Index: trunk/extensions/DumpHTML/dumpHTML.inc |
— | — | @@ -1144,12 +1144,12 @@ |
1145 | 1145 | $this->udpProfileCounter = 0; |
1146 | 1146 | } elseif ( $this->udpProfileCounter == 1 % $this->udpProfile ) { |
1147 | 1147 | wfProfileOut( '-total' ); |
1148 | | - $wgProfiler->getFunctionReport(); |
1149 | | - $wgProfiler = new DumpHTML_ProfilerStub; |
| 1148 | + Profiler::instance()->getFunctionReport(); |
| 1149 | + Profiler::setInstance( new DumpHTML_ProfilerStub ); |
1150 | 1150 | } |
1151 | 1151 | if ( $this->udpProfileCounter == 0 ) { |
1152 | | - $wgProfiler = new ProfilerSimpleUDP; |
1153 | | - $wgProfiler->setProfileID( 'dumpHTML' ); |
| 1152 | + Profiler::setInstance( new ProfilerSimpleUDP ); |
| 1153 | + Profiler::instance()->setProfileID( 'dumpHTML' ); |
1154 | 1154 | $wgRequestTime = microtime( true ); |
1155 | 1155 | $wgRUstart = getrusage(); |
1156 | 1156 | wfProfileIn( '-total' ); |
— | — | @@ -1172,7 +1172,7 @@ |
1173 | 1173 | } |
1174 | 1174 | } |
1175 | 1175 | |
1176 | | -class DumpHTML_ProfilerStub { |
| 1176 | +class DumpHTML_ProfilerStub extends Profiler { |
1177 | 1177 | function profileIn() {} |
1178 | 1178 | function profileOut() {} |
1179 | 1179 | function getOutput() {} |