diff --git a/Database.php b/Database.php index bb96507296..23dca3039b 100644 --- a/Database.php +++ b/Database.php @@ -96,11 +96,14 @@ ]; } +$wgLBFactoryConf['loadMonitor']['class'] = '\Wikimedia\Rdbms\LoadMonitor'; // Disable LoadMonitor in CLI, it doesn't provide much value in CLI. if ( PHP_SAPI === 'cli' ) { - $wgLBFactoryConf['loadMonitorClass'] = \Wikimedia\Rdbms\LoadMonitorNull::class; + $wgLBFactoryConf['loadMonitor']['class'] = '\Wikimedia\Rdbms\LoadMonitorNull'; } +$wgLBFactoryConf['loadMonitor']['maxConnCount'] = 350; + // Disallow web request database transactions that are slower than 10 seconds $wgMaxUserDBWriteDuration = 10; diff --git a/LocalWiki.php b/LocalWiki.php index 634bec6324..b18dad3fb6 100644 --- a/LocalWiki.php +++ b/LocalWiki.php @@ -697,13 +697,13 @@ function onBeforePageDisplay( OutputPage $out ) { break; case 'testwikibeta': - $wgUserLevels = array( + $wgUserLevels = [ 'Recruit' => 0, 'Apprentice' => 1200, 'Private' => 1750, 'Corporal' => 2500, 'Sergeant' => 5000, - 'Gunnery Sergeant' =>10000, + 'Gunnery Sergeant' => 10000, 'Lieutenant' => 20000, 'Captain' => 35000, 'Major' => 50000, @@ -716,7 +716,7 @@ function onBeforePageDisplay( OutputPage $out ) { 'Lieutenant General' => 650000, 'General' => 800000, 'General of the Army' => 1000000, - ); + ]; break; case 'tuscriaturaswiki': $wgHooks['AfterFinalPageOutput'][] = 'onAfterFinalPageOutput'; diff --git a/rpc/RunJobs.php b/rpc/RunJobs.php index 131639e308..77a0b6cc16 100644 --- a/rpc/RunJobs.php +++ b/rpc/RunJobs.php @@ -24,7 +24,7 @@ use MediaWiki\MediaWikiServices; -if ( !in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '0:0:0:0:0:0:0:1', '::1' ), true ) ) { +if ( !in_array( $_SERVER['REMOTE_ADDR'], [ '127.0.0.1', '0:0:0:0:0:0:0:1', '::1' ], true ) ) { http_response_code( 500 ); die( "Only loopback requests are allowed.\n" ); } elseif ( $_SERVER['REQUEST_METHOD'] !== 'POST' ) {