From: Aaron Schulz Date: Mon, 24 Jun 2019 20:45:01 +0000 (-0700) Subject: rdbms: deprecate LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad() X-Git-Tag: 1.34.0-rc.0~1151^2~1 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=4c3b7441f06a177c5ac7a51d01371d29d66704ad;p=lhc%2Fweb%2Fwiklou.git rdbms: deprecate LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad() This methods are not used anywhere and have no known use case. Change-Id: I213d7b9cfacb5a966fe5ce9c7b377e1d4eb2cec9 --- diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index fdc9e055e2..acd82d63be 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -327,6 +327,8 @@ because of Phabricator reports. engines. * Skin::escapeSearchLink() is deprecated. Use Skin::getSearchLink() or the skin template option 'searchaction' instead. +* LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad() have + been deprecated. === Other changes in 1.34 === * … diff --git a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php index 4d148b4c90..b086beb31c 100644 --- a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php @@ -314,22 +314,6 @@ interface ILoadBalancer { */ public function getWriterIndex(); - /** - * Returns true if the specified index is a valid server index - * - * @param int $i - * @return bool - */ - public function haveIndex( $i ); - - /** - * Returns true if the specified index is valid and has non-zero load - * - * @param int $i - * @return bool - */ - public function isNonZeroLoad( $i ); - /** * Get the number of servers defined in configuration * diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 7f12d14bb0..44d526c2e2 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -1306,10 +1306,24 @@ class LoadBalancer implements ILoadBalancer { return 0; } + /** + * Returns true if the specified index is a valid server index + * + * @param int $i + * @return bool + * @deprecated Since 1.34 + */ public function haveIndex( $i ) { return array_key_exists( $i, $this->servers ); } + /** + * Returns true if the specified index is valid and has non-zero load + * + * @param int $i + * @return bool + * @deprecated Since 1.34 + */ public function isNonZeroLoad( $i ) { return array_key_exists( $i, $this->servers ) && $this->genericLoads[$i] != 0; }