WebRequest::getHeader: add optional flag to get back list
[lhc/web/wiklou.git] / maintenance / Maintenance.php
index a8dbd5f..3f804a0 100644 (file)
@@ -603,10 +603,14 @@ abstract class Maintenance {
         * Activate the profiler (assuming $wgProfiler is set)
         */
        protected function activateProfiler() {
-               global $wgProfiler;
+               global $wgProfiler, $wgTrxProfilerLimits;
 
                $output = $this->getOption( 'profiler' );
-               if ( $output && is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) {
+               if ( !$output ) {
+                       return;
+               }
+
+               if ( is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) {
                        $class = $wgProfiler['class'];
                        $profiler = new $class(
                                array( 'sampling' => 1, 'output' => $output ) + $wgProfiler
@@ -617,8 +621,7 @@ abstract class Maintenance {
 
                $trxProfiler = Profiler::instance()->getTransactionProfiler();
                $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) );
-               # Catch huge single updates that lead to slave lag
-               $trxProfiler->setExpectation( 'maxAffected', 1000, __METHOD__ );
+               $trxProfiler->setExpectations( $wgTrxProfilerLimits['Maintenance'], __METHOD__ );
        }
 
        /**
@@ -1106,7 +1109,7 @@ abstract class Maintenance {
         */
        private function lockSearchindex( $db ) {
                $write = array( 'searchindex' );
-               $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user' );
+               $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user', 'page_restrictions' );
                $db->lockTables( $read, $write, __CLASS__ . '::' . __METHOD__ );
        }