Merge "[BREAKING CHANGE] Rename TitleWidget#getTitle to TitleWidget#getMWTitle"
[lhc/web/wiklou.git] / includes / profiler / Profiler.php
index 8b4f01a..81449be 100644 (file)
@@ -22,6 +22,7 @@
  * @defgroup Profiler Profiler
  */
 use Wikimedia\ScopedCallback;
+use Wikimedia\Rdbms\TransactionProfiler;
 
 /**
  * Profiler base class that defines the interface and some trivial
@@ -73,7 +74,8 @@ abstract class Profiler {
                        }
 
                        $inSample = mt_rand( 0, $params['sampling'] - 1 ) === 0;
-                       if ( PHP_SAPI === 'cli' || !$inSample ) {
+                       // wfIsCLI() is not available yet
+                       if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' || !$inSample ) {
                                $params['class'] = 'ProfilerStub';
                        }
 
@@ -163,7 +165,7 @@ abstract class Profiler {
        abstract public function scopedProfileIn( $section );
 
        /**
-        * @param SectionProfileCallback $section
+        * @param SectionProfileCallback &$section
         */
        public function scopedProfileOut( SectionProfileCallback &$section = null ) {
                $section = null;