From: Stanislav Malyshev Date: Wed, 17 Apr 2019 23:46:18 +0000 (-0700) Subject: rdbms: add getChronologyProtectorClientId() to ILBFactory X-Git-Tag: 1.34.0-rc.0~1918^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=c53cf78f792a5d7b1b16b952e38d556cd5316bc2;p=lhc%2Fweb%2Fwiklou.git rdbms: add getChronologyProtectorClientId() to ILBFactory Returns the client ID used by ChronologyProtector. Bug: T212550 Change-Id: Ia7d24d6591d6a8696103c560ea4b2c9718fd0ec2 --- diff --git a/includes/libs/rdbms/lbfactory/ILBFactory.php b/includes/libs/rdbms/lbfactory/ILBFactory.php index cb8be212b8..06e45f80f3 100644 --- a/includes/libs/rdbms/lbfactory/ILBFactory.php +++ b/includes/libs/rdbms/lbfactory/ILBFactory.php @@ -356,6 +356,14 @@ interface ILBFactory { */ public function appendShutdownCPIndexAsQuery( $url, $index ); + /** + * Get the client ID of the ChronologyProtector instance + * + * @return string Client ID + * @since 1.34 + */ + public function getChronologyProtectorClientId(); + /** * @param array $info Map of fields, including: * - IPAddress : IP address diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php b/includes/libs/rdbms/lbfactory/LBFactory.php index 3a8f2e1fcd..b02c1b7724 100644 --- a/includes/libs/rdbms/lbfactory/LBFactory.php +++ b/includes/libs/rdbms/lbfactory/LBFactory.php @@ -674,6 +674,10 @@ abstract class LBFactory implements ILBFactory { return strpos( $url, '?' ) === false ? "$url?cpPosIndex=$index" : "$url&cpPosIndex=$index"; } + public function getChronologyProtectorClientId() { + return $this->getChronologyProtector()->getClientId(); + } + /** * @param int $index Write index * @param int $time UNIX timestamp; can be used to detect stale cookies (T190082)