rdbms: add getChronologyProtectorClientId() to ILBFactory
authorStanislav Malyshev <smalyshev@gmail.com>
Wed, 17 Apr 2019 23:46:18 +0000 (16:46 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 19 Apr 2019 23:28:42 +0000 (16:28 -0700)
Returns the client ID used by ChronologyProtector.

Bug: T212550
Change-Id: Ia7d24d6591d6a8696103c560ea4b2c9718fd0ec2

includes/libs/rdbms/lbfactory/ILBFactory.php
includes/libs/rdbms/lbfactory/LBFactory.php

index cb8be21..06e45f8 100644 (file)
@@ -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
index 3a8f2e1..b02c1b7 100644 (file)
@@ -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)