Merge "Simplify HTMLTitleTextField::validate"
[lhc/web/wiklou.git] / includes / libs / rdbms / lbfactory / ILBFactory.php
index 85ab115..8e35456 100644 (file)
@@ -67,6 +67,22 @@ interface ILBFactory {
         */
        public function destroy();
 
+       /**
+        * Get the local (and default) database domain ID of connection handles
+        *
+        * @see DatabaseDomain
+        * @return string Database domain ID; this specifies DB name, schema, and table prefix
+        * @since 1.32
+        */
+       public function getLocalDomainID();
+
+       /**
+        * @param DatabaseDomain|string|bool $domain Database domain
+        * @return string Value of $domain if provided or the local domain otherwise
+        * @since 1.32
+        */
+       public function resolveDomainID( $domain );
+
        /**
         * Create a new load balancer object. The resulting object will be untracked,
         * not chronology-protected, and the caller is responsible for cleaning it up.
@@ -229,7 +245,7 @@ interface ILBFactory {
 
        /**
         * Determine if any master connection has pending/written changes from this request
-        * @param float $age How many seconds ago is "recent" [defaults to LB lag wait timeout]
+        * @param float|null $age How many seconds ago is "recent" [defaults to LB lag wait timeout]
         * @return bool
         */
        public function hasOrMadeRecentMasterChanges( $age = null );
@@ -253,9 +269,9 @@ interface ILBFactory {
         * @param array $opts Optional fields that include:
         *   - domain : wait on the load balancer DBs that handles the given domain ID
         *   - cluster : wait on the given external load balancer DBs
-        *   - timeout : Max wait time. Default: ~60 seconds
+        *   - timeout : Max wait time. Default: 60 seconds for CLI, 1 second for web.
         *   - ifWritesSince: Only wait if writes were done since this UNIX timestamp
-        * @throws DBReplicationWaitError If a timeout or error occurred waiting on a DB cluster
+        * @return bool True on success, false if a timeout or error occurred while waiting
         */
        public function waitForReplication( array $opts = [] );
 
@@ -285,7 +301,7 @@ interface ILBFactory {
         * @param string $fname Caller name (e.g. __METHOD__)
         * @param mixed $ticket Result of getEmptyTransactionTicket()
         * @param array $opts Options to waitForReplication()
-        * @throws DBReplicationWaitError
+        * @return bool True if the wait was successful, false on timeout
         */
        public function commitAndWaitForReplication( $fname, $ticket, array $opts = [] );
 
@@ -322,7 +338,7 @@ interface ILBFactory {
        /**
         * Append ?cpPosIndex parameter to a URL for ChronologyProtector purposes if needed
         *
-        * Note that unlike cookies, this works accross domains
+        * Note that unlike cookies, this works across domains
         *
         * @param string $url
         * @param int $index Write counter index