Merge "Exclude redirects from Special:Fewestrevisions"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / IDatabase.php
index fca2c00..ef7f1e2 100644 (file)
@@ -223,14 +223,12 @@ interface IDatabase {
        public function getLBInfo( $name = null );
 
        /**
-        * Set the LB info array, or a member of it. If called with one parameter,
-        * the LB info array is set to that parameter. If it is called with two
-        * parameters, the member with the given name is set to the given value.
+        * Set the entire array or a particular key of the managing load balancer info array
         *
-        * @param array|string $name
-        * @param array|null $value
+        * @param array|string $nameOrArray The new array or the name of a key to set
+        * @param array|null $value If $nameOrArray is a string, the new key value (null to unset)
         */
-       public function setLBInfo( $name, $value = null );
+       public function setLBInfo( $nameOrArray, $value = null );
 
        /**
         * Set a lazy-connecting DB handle to the master DB (for replication status purposes)
@@ -1158,7 +1156,7 @@ interface IDatabase {
        /**
         * Change the current database
         *
-        * This should not be called outside LoadBalancer for connections managed by a LoadBalancer
+        * This should only be called by a load balancer or if the handle is not attached to one
         *
         * @param string $db
         * @return bool True unless an exception was thrown
@@ -1171,9 +1169,9 @@ interface IDatabase {
        /**
         * Set the current domain (database, schema, and table prefix)
         *
-        * This will throw an error for some database types if the database unspecified
+        * This will throw an error for some database types if the database is unspecified
         *
-        * This should not be called outside LoadBalancer for connections managed by a LoadBalancer
+        * This should only be called by a load balancer or if the handle is not attached to one
         *
         * @param string|DatabaseDomain $domain
         * @since 1.32
@@ -1944,7 +1942,7 @@ interface IDatabase {
         *
         * @throws DBError
         */
-       public function commit( $fname = __METHOD__, $flush = '' );
+       public function commit( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
 
        /**
         * Rollback a transaction previously started using begin().
@@ -1966,7 +1964,7 @@ interface IDatabase {
         * @throws DBError
         * @since 1.23 Added $flush parameter
         */
-       public function rollback( $fname = __METHOD__, $flush = '' );
+       public function rollback( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
 
        /**
         * Commit any transaction but error out if writes or callbacks are pending
@@ -1977,10 +1975,20 @@ interface IDatabase {
         * useful to call on a replica DB after waiting on replication to catch up to the master.
         *
         * @param string $fname Calling function name
+        * @param string $flush Flush flag, set to situationally valid IDatabase::FLUSHING_*
+        *   constant to disable warnings about explicitly committing implicit transactions,
+        *   or calling commit when no transaction is in progress.
+        *
+        *   This will trigger an exception if there is an ongoing explicit transaction.
+        *
+        *   Only set the flush flag if you are sure that these warnings are not applicable,
+        *   and no explicit transactions are open.
+        *
         * @throws DBError
         * @since 1.28
+        * @since 1.34 Added $flush parameter
         */
-       public function flushSnapshot( $fname = __METHOD__ );
+       public function flushSnapshot( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
 
        /**
         * Convert a timestamp in one of the formats accepted by wfTimestamp()
@@ -2112,7 +2120,7 @@ interface IDatabase {
         *
         * @param string $lockName Name of lock to aquire
         * @param string $method Name of the calling method
-        * @param int $timeout Acquisition timeout in seconds
+        * @param int $timeout Acquisition timeout in seconds (0 means non-blocking)
         * @return bool
         * @throws DBError
         */