dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Warn if stateful ParserOutput transforms are used"
[lhc/web/wiklou.git]
/
includes
/
profiler
/
Profiler.php
diff --git
a/includes/profiler/Profiler.php
b/includes/profiler/Profiler.php
index
252a227
..
9021652
100644
(file)
--- a/
includes/profiler/Profiler.php
+++ b/
includes/profiler/Profiler.php
@@
-64,7
+64,7
@@
abstract class Profiler {
global $wgProfiler, $wgProfileLimit;
$params = [
global $wgProfiler, $wgProfileLimit;
$params = [
- 'class' =>
'ProfilerStub'
,
+ 'class' =>
ProfilerStub::class
,
'sampling' => 1,
'threshold' => $wgProfileLimit,
'output' => [],
'sampling' => 1,
'threshold' => $wgProfileLimit,
'output' => [],
@@
-74,8
+74,9
@@
abstract class Profiler {
}
$inSample = mt_rand( 0, $params['sampling'] - 1 ) === 0;
}
$inSample = mt_rand( 0, $params['sampling'] - 1 ) === 0;
- if ( PHP_SAPI === 'cli' || !$inSample ) {
- $params['class'] = 'ProfilerStub';
+ // wfIsCLI() is not available yet
+ if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' || !$inSample ) {
+ $params['class'] = ProfilerStub::class;
}
if ( !is_array( $params['output'] ) ) {
}
if ( !is_array( $params['output'] ) ) {
@@
-164,7
+165,7
@@
abstract class Profiler {
abstract public function scopedProfileIn( $section );
/**
abstract public function scopedProfileIn( $section );
/**
- * @param SectionProfileCallback $section
+ * @param SectionProfileCallback
&
$section
*/
public function scopedProfileOut( SectionProfileCallback &$section = null ) {
$section = null;
*/
public function scopedProfileOut( SectionProfileCallback &$section = null ) {
$section = null;