Merge "Follow up change Icc8dc4ae: add new message keys to maintenance scripts"
[lhc/web/wiklou.git] / includes / ExternalStoreDB.php
index fee49f2..241c43c 100644 (file)
@@ -73,6 +73,7 @@ class ExternalStoreDB {
        /**
         * Fetch data from given URL
         * @param $url String: an url of the form DB://cluster/id or DB://cluster/id/itemid for concatened storage.
+        * @return mixed
         */
        function fetchFromURL( $url ) {
                $path = explode( '/', $url );
@@ -120,12 +121,12 @@ class ExternalStoreDB {
                wfDebug( "ExternalStoreDB::fetchBlob cache miss on $cacheID\n" );
 
                $dbr =& $this->getSlave( $cluster );
-               $ret = $dbr->selectField( $this->getTable( $dbr ), 'blob_text', array( 'blob_id' => $id ) );
+               $ret = $dbr->selectField( $this->getTable( $dbr ), 'blob_text', array( 'blob_id' => $id ), __METHOD__ );
                if ( $ret === false ) {
                        wfDebugLog( 'ExternalStoreDB', "ExternalStoreDB::fetchBlob master fallback on $cacheID\n" );
                        // Try the master
                        $dbw =& $this->getMaster( $cluster );
-                       $ret = $dbw->selectField( $this->getTable( $dbw ), 'blob_text', array( 'blob_id' => $id ) );
+                       $ret = $dbw->selectField( $this->getTable( $dbw ), 'blob_text', array( 'blob_id' => $id ), __METHOD__ );
                        if( $ret === false) {
                                wfDebugLog( 'ExternalStoreDB', "ExternalStoreDB::fetchBlob master failed to find $cacheID\n" );
                        }
@@ -157,7 +158,7 @@ class ExternalStoreDB {
                        throw new MWException( __METHOD__.': no insert ID' );
                }
                if ( $dbw->getFlag( DBO_TRX ) ) {
-                       $dbw->commit();
+                       $dbw->commit( __METHOD__ );
                }
                return "DB://$cluster/$id";
        }