From 45a197b1a59696b87050821c284f09db92f58d05 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 11 Dec 2012 12:57:37 +0100 Subject: [PATCH] (bug 42948) $wiki parameter for getRevisionText(). Revision::getRevisionText should take wiki identifier, to allow for the loading of revision blobs from another wiki's database. This is passed through to ExternalStoreDB, so it uses the correct database connection. Change-Id: I14a7ebb8aa31a4e50735db9c28ff8d2759cd872c --- includes/Revision.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index 5d6bcbdd6b..cc79c644a5 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1148,9 +1148,13 @@ class Revision implements IDBAccessObject { * * @param $row Object: the text data * @param $prefix String: table prefix (default 'old_') + * @param $wiki String|false: the name of the wiki to load the revision text from + * (same as the the wiki $row was loaded from) or false to indicate the local + * wiki (this is the default). Otherwise, it must be a symbolic wiki database + * identifier as understood by the LoadBalancer class. * @return String: text the text requested or false on failure */ - public static function getRevisionText( $row, $prefix = 'old_' ) { + public static function getRevisionText( $row, $prefix = 'old_', $wiki = false ) { wfProfileIn( __METHOD__ ); # Get data @@ -1178,7 +1182,7 @@ class Revision implements IDBAccessObject { wfProfileOut( __METHOD__ ); return false; } - $text = ExternalStore::fetchFromURL( $url ); + $text = ExternalStore::fetchFromURL( $url, array( 'wiki' => $wiki ) ); } // If the text was fetched without an error, convert it -- 2.20.1