Merge "mediawiki.searchSuggest: Show full article title as a tooltip for each suggestion"
[lhc/web/wiklou.git] / includes / db / LBFactory.php
index ae105e2..bea195b 100644 (file)
@@ -179,7 +179,7 @@ abstract class LBFactory {
         * Private helper for forEachLBCallMethod
         * @param LoadBalancer $loadBalancer
         * @param string $methodName
-        * @param $args
+        * @param array $args
         */
        function callMethod( $loadBalancer, $methodName, $args ) {
                call_user_func_array( array( $loadBalancer, $methodName ), $args );
@@ -191,6 +191,27 @@ abstract class LBFactory {
        function commitMasterChanges() {
                $this->forEachLBCallMethod( 'commitMasterChanges' );
        }
+
+       /**
+        * Rollback changes on all master connections
+        * @since 1.23
+        */
+       function rollbackMasterChanges() {
+               $this->forEachLBCallMethod( 'rollbackMasterChanges' );
+       }
+
+       /**
+        * Detemine if any master connection has pending changes.
+        * @since 1.23
+        * @return bool
+        */
+       function hasMasterChanges() {
+               $ret = false;
+               $this->forEachLB( function ( $lb ) use ( &$ret ) {
+                       $ret = $ret || $lb->hasMasterChanges();
+               } );
+               return $ret;
+       }
 }
 
 /**
@@ -222,7 +243,10 @@ class LBFactorySimple extends LBFactory {
                        global $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, $wgDBtype, $wgDebugDumpSql;
                        global $wgDBssl, $wgDBcompress;
 
-                       $flags = ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT;
+                       $flags = DBO_DEFAULT;
+                       if ( $wgDebugDumpSql ) {
+                               $flags |= DBO_DEBUG;
+                       }
                        if ( $wgDBssl ) {
                                $flags |= DBO_SSL;
                        }