X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Feval.php;h=40d29ef87c941474bd015b1b35f6ab9b1e6493c3;hb=801a8bdaa38cea5ff4db0440c82e9eb83e083772;hp=25ecc09980c14e26d40986cc31a0e020882d48b1;hpb=31d0a18d3efd13f025633df1cc5a5be7b058f9a3;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/eval.php b/maintenance/eval.php index 25ecc09980..40d29ef87c 100644 --- a/maintenance/eval.php +++ b/maintenance/eval.php @@ -30,27 +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 ); - } - } - if ( $d > 2 ) { - $wgDebugFunctionEntry = true; + wfGetDB( DB_MASTER )->setFlag( DBO_DEBUG ); + wfGetDB( DB_REPLICA )->setFlag( DBO_DEBUG ); } }