Use link() instead of make*Link*()
[lhc/web/wiklou.git] / includes / ExternalStoreDB.php
index caac3b1..9aa3af8 100644 (file)
@@ -26,21 +26,29 @@ $wgExternalBlobCache = array();
  */
 class ExternalStoreDB {
 
+       function __construct( $params = array() ) {
+               $this->mParams = $params;
+       }
+
        /** @todo Document.*/
        function &getLoadBalancer( $cluster ) {
-               return wfGetLBFactory()->getExternalLB( $cluster );
+               $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false;
+               
+               return wfGetLBFactory()->getExternalLB( $cluster, $wiki );
        }
 
        /** @todo Document.*/
        function &getSlave( $cluster ) {
+               $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false;
                $lb =& $this->getLoadBalancer( $cluster );
-               return $lb->getConnection( DB_SLAVE );
+               return $lb->getConnection( DB_SLAVE, array(), $wiki );
        }
 
        /** @todo Document.*/
        function &getMaster( $cluster ) {
+               $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false;
                $lb =& $this->getLoadBalancer( $cluster );
-               return $lb->getConnection( DB_MASTER, array() );
+               return $lb->getConnection( DB_MASTER, array(), $wiki );
        }
 
        /** @todo Document.*/
@@ -123,7 +131,6 @@ class ExternalStoreDB {
         */
        function store( $cluster, $data ) {
                $dbw = $this->getMaster( $cluster );
-
                $id = $dbw->nextSequenceValue( 'blob_blob_id_seq' );
                $dbw->insert( $this->getTable( $dbw ), 
                        array( 'blob_id' => $id, 'blob_text' => $data ),