Merge "Break some long lines in maintenance, skins, tests"
[lhc/web/wiklou.git] / includes / db / LoadBalancer.php
index 5353288..0379e86 100644 (file)
@@ -43,7 +43,7 @@ class LoadBalancer {
        private $mLoadMonitorClass, $mLoadMonitor;
 
        /**
-        * @param array $params with keys:
+        * @param array $params Array with keys:
         *   servers           Required. Array of server info structures.
         *   loadMonitor       Name of a class used to fetch server lag and load.
         * @throws MWException
@@ -948,6 +948,14 @@ class LoadBalancer {
                }
        }
 
+       /**
+        * @return bool Whether a master connection is already open
+        * @since 1.24
+        */
+       function hasMasterConnection() {
+               return $this->isOpen( $this->getWriterIndex() );
+       }
+
        /**
         * Determine if there are any pending changes that need to be rolled back
         * or committed.