X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=a8dbd5f28061e6a54ad72442efb51cda6605a9e2;hb=c5b6003d713f4f2392cb19a280f4c6614bc829cd;hp=af14bb36fc6154ceafdc1d8ff2bdf39f281e5722;hpb=23650785efd515088e41a12bf4dff70ca3467ccc;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index af14bb36fc..a8dbd5f280 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -38,6 +38,8 @@ define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless $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 @@ -612,6 +614,11 @@ abstract class Maintenance { $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__ ); } /** @@ -696,6 +703,9 @@ abstract class Maintenance { } $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 );