$maintClass = false;
+use MediaWiki\Logger\LoggerFactory;
+
/**
* Abstract maintenance class for quickly writing and churning out
* maintenance scripts with minimal effort. All that _must_ be defined
$profiler->setTemplated( true );
Profiler::replaceStubInstance( $profiler );
}
+
+ $trxProfiler = Profiler::instance()->getTransactionProfiler();
+ $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) );
+ # Catch huge single updates that lead to slave lag
+ $trxProfiler->setExpectation( 'maxAffected', 1000, __METHOD__ );
}
/**
}
$options[$option] = $param;
}
+ } elseif ( $arg == '-' ) {
+ # Lonely "-", often used to indicate stdin or stdout.
+ $args[] = $arg;
} elseif ( substr( $arg, 0, 1 ) == '-' ) {
# Short options
$argLength = strlen( $arg );
*/
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__ );
}