Merge "Add flexbox mixins to mediawiki.mixins"
[lhc/web/wiklou.git] / includes / db / loadbalancer / LBFactorySingle.php
index a41dadf..5a6cfa7 100644 (file)
@@ -33,6 +33,9 @@ class LBFactorySingle extends LBFactory {
         *  - connection: The DatabaseBase connection object
         */
        public function __construct( array $conf ) {
+               parent::__construct( $conf );
+
+               $conf['readOnlyReason'] = $this->readOnlyReason;
                $this->lb = new LoadBalancerSingle( $conf );
        }
 
@@ -91,12 +94,21 @@ 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,
+                               )
+                       )
+               ) );
+
+               if ( isset( $params['readOnlyReason'] ) ) {
+                       $this->db->setLBInfo( 'readOnlyReason', $params['readOnlyReason'] );
+               }
        }
 
        /**