From 50a69c753f073dd0d6bf86ee981405f31befddc8 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Mon, 30 Jun 2008 09:22:00 +0000 Subject: [PATCH] Partial revert of r36804: Removing the wfSharedTable function. The function uses a $wgExternalSharedDB which is not part of Core, and has not been defined in default settings. The variable itself has no apparent purpose and is likely to make the existing use of $wgSharedDB even more complex and prone to breakage. The function wfSharedTable itself, appears more like a Wikia made function to support transition of 1.12 wiki in which $wgSharedTables did not exist over to 1.13 in which it does exist. If this is the actual point of it, then it serves no point in being added to core. 1.13 already has $wgSharedTables and it serves better to append to that, than to use wfSharedTable. This is something that extensions should be defining themselves if they need it for transition from old 1.12 wiki to 1.13. --- RELEASE-NOTES | 2 -- includes/GlobalFunctions.php | 21 --------------------- 2 files changed, 23 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fecd299ccd..717e4e4e7f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -174,8 +174,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Allow extensions to modify the user creation form by calling addInputItem(); * Add meta generator tag to HTML output * Two new hooks, ExtendJSGlobalVars and wfMessageCacheReplace added -* New global function, wfSharedTable - used to get the name of a table in the - shared database ($wgSharedDB) === Bug fixes in 1.13 === diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index fe82f1ee1e..074014a8d4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2674,25 +2674,4 @@ function wfGenerateToken( $salt = '' ) { $salt = serialize($salt); return md5( mt_rand( 0, 0x7fffffff ) . $salt ); -} - -/** - * Create table name for shared database. - * - * @access public - * @author eloy@wikia - * - * @param string $table: table name - * - * @return string: table name with additional shared database - */ -function wfSharedTable( $table, $useExternal = true ) { - global $wgSharedDB, $wgExternalSharedDB; - - if ($useExternal && !empty( $wgExternalSharedDB )) { - return "`$wgExternalSharedDB`.`$table`"; - } elseif (!empty( $wgSharedDB )) { - return "`$wgSharedDB`.`$table`"; - } else - return "`$table`"; } \ No newline at end of file -- 2.20.1