X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2Feval.php;h=40d29ef87c941474bd015b1b35f6ab9b1e6493c3;hb=bc7f55fcf489dd07b0d320e23021133a7f6fc133;hp=e20c477af05490dba5064d5e0edfcc8e88dfb341;hpb=812fb5f5bdc07ec203bbb5d1c7ca5350355f7c4b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/eval.php b/maintenance/eval.php index e20c477af0..40d29ef87c 100644 --- a/maintenance/eval.php +++ b/maintenance/eval.php @@ -30,24 +30,24 @@ * @ingroup Maintenance */ -$optionsWithArgs = array( 'd' ); +use MediaWiki\Logger\LoggerFactory; +use MediaWiki\Logger\ConsoleSpi; +use MediaWiki\MediaWikiServices; + +$optionsWithArgs = [ 'd' ]; -/** */ require_once __DIR__ . "/commandLine.inc"; if ( isset( $options['d'] ) ) { $d = $options['d']; if ( $d > 0 ) { - $wgDebugLogFile = '/dev/stdout'; + LoggerFactory::registerProvider( new ConsoleSpi ); + // Some services hold Logger instances in object properties + MediaWikiServices::resetGlobalInstance(); } if ( $d > 1 ) { - $lb = wfGetLB(); - $serverCount = $lb->getServerCount(); - for ( $i = 0; $i < $serverCount; $i++ ) { - $server = $lb->getServerInfo( $i ); - $server['flags'] |= DBO_DEBUG; - $lb->setServerInfo( $i, $server ); - } + wfGetDB( DB_MASTER )->setFlag( DBO_DEBUG ); + wfGetDB( DB_REPLICA )->setFlag( DBO_DEBUG ); } }