Merge "ChangeTags: Teach updateTags() to derive log_id from rev_id (and the other...
[lhc/web/wiklou.git] / includes / db / loadbalancer / LBFactorySingle.php
index a41dadf..cbe9517 100644 (file)
@@ -33,7 +33,12 @@ class LBFactorySingle extends LBFactory {
         *  - connection: The DatabaseBase connection object
         */
        public function __construct( array $conf ) {
-               $this->lb = new LoadBalancerSingle( $conf );
+               parent::__construct( $conf );
+
+               $this->lb = new LoadBalancerSingle( array(
+                       'readOnlyReason' => $this->readOnlyReason,
+                       'trxProfiler' => $this->trxProfiler
+               ) + $conf );
        }
 
        /**
@@ -91,12 +96,22 @@ class LoadBalancerSingle extends LoadBalancer {
         */
        public function __construct( array $params ) {
                $this->db = $params['connection'];
-               parent::__construct( array( 'servers' => array( array(
-                       'type' => $this->db->getType(),
-                       'host' => $this->db->getServer(),
-                       'dbname' => $this->db->getDBname(),
-                       'load' => 1,
-               ) ) ) );
+
+               parent::__construct( array(
+                       'servers' => array(
+                               array(
+                                       'type' => $this->db->getType(),
+                                       'host' => $this->db->getServer(),
+                                       'dbname' => $this->db->getDBname(),
+                                       'load' => 1,
+                               )
+                       ),
+                       'trxProfiler' => $this->trxProfiler
+               ) );
+
+               if ( isset( $params['readOnlyReason'] ) ) {
+                       $this->db->setLBInfo( 'readOnlyReason', $params['readOnlyReason'] );
+               }
        }
 
        /**