From: Aaron Schulz Date: Thu, 29 Mar 2018 02:24:39 +0000 (-0700) Subject: rdbms: make LBFactory "cliMode" check for phpdbg X-Git-Tag: 1.31.0-rc.0~115^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=5bad47dbb4519d6a67a2aba468fb513319311c9a;ds=inline rdbms: make LBFactory "cliMode" check for phpdbg Change-Id: I618a975198f1432b21e03efa40520d4819a7ce5f --- diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php b/includes/libs/rdbms/lbfactory/LBFactory.php index bc428ece00..64b54e47ae 100644 --- a/includes/libs/rdbms/lbfactory/LBFactory.php +++ b/includes/libs/rdbms/lbfactory/LBFactory.php @@ -124,7 +124,9 @@ abstract class LBFactory implements ILBFactory { 'ChronologyPositionIndex' => isset( $_GET['cpPosIndex'] ) ? $_GET['cpPosIndex'] : null ]; - $this->cliMode = isset( $conf['cliMode'] ) ? $conf['cliMode'] : PHP_SAPI === 'cli'; + $this->cliMode = isset( $conf['cliMode'] ) + ? $conf['cliMode'] + : ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ); $this->hostname = isset( $conf['hostname'] ) ? $conf['hostname'] : gethostname(); $this->agent = isset( $conf['agent'] ) ? $conf['agent'] : ''; diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 4de17b7547..750df0f4c2 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -532,7 +532,7 @@ class LoadBalancer implements ILoadBalancer { if ( $this->loads[$i] > 0 ) { $start = microtime( true ); $ok = $this->doWait( $i, true, $timeout ) && $ok; - $timeout -= ( microtime( true ) - $start ); + $timeout -= intval( microtime( true ) - $start ); if ( $timeout <= 0 ) { break; // timeout reached }