Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/134962
Change subject: Allow faux-renaming/database remapping ...................................................................... Allow faux-renaming/database remapping Example with chapcomwiki -> affcomwiki Change-Id: I47e7dd3ef0052c863bdf32082899cf824b290407 --- M multiversion/MWMultiVersion.php 1 file changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/62/134962/1 diff --git a/multiversion/MWMultiVersion.php b/multiversion/MWMultiVersion.php index 526b397..d3410e5 100644 --- a/multiversion/MWMultiVersion.php +++ b/multiversion/MWMultiVersion.php @@ -43,7 +43,7 @@ */ public static function newFromDBName( $dbName ) { $m = new self(); - $m->db = $dbName; + $m->db = $m->remapDatabase( $dbName ); return $m; } @@ -214,7 +214,19 @@ self::error( "--wiki must be the first parameter.\n" ); } - $this->db = $dbname; + $this->db = $this->remapDatabase( $dbname ); + } + + /** + * @param string $dbname + * @return string + */ + private function remapDatabase( $dbName ) { + switch ( $dbName ) { + case 'chapcomwiki': + return 'affcomwiki'; + } + return $dbName; } /** @@ -228,7 +240,7 @@ } else { $dbSuffix = $site; } - $this->db = str_replace( "-", "_", $lang . $dbSuffix ); + $this->db = $this->remapDatabase( str_replace( "-", "_", $lang . $dbSuffix ) ); } /** -- To view, visit https://gerrit.wikimedia.org/r/134962 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47e7dd3ef0052c863bdf32082899cf824b290407 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy <re...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits