r36809 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36808‎ | r36809 | r36810 >
Date:09:22, 30 June 2008
Author:dantman
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2674,25 +2674,4 @@
26752675 $salt = serialize($salt);
26762676
26772677 return md5( mt_rand( 0, 0x7fffffff ) . $salt );
2678 -}
2679 -
2680 -/**
2681 - * Create table name for shared database.
2682 - *
2683 - * @access public
2684 - * @author eloy@wikia
2685 - *
2686 - * @param string $table: table name
2687 - *
2688 - * @return string: table name with additional shared database
2689 - */
2690 -function wfSharedTable( $table, $useExternal = true ) {
2691 - global $wgSharedDB, $wgExternalSharedDB;
2692 -
2693 - if ($useExternal && !empty( $wgExternalSharedDB )) {
2694 - return "`$wgExternalSharedDB`.`$table`";
2695 - } elseif (!empty( $wgSharedDB )) {
2696 - return "`$wgSharedDB`.`$table`";
2697 - } else
2698 - return "`$table`";
26992678 }
\ No newline at end of file
Index: trunk/phase3/RELEASE-NOTES
@@ -174,8 +174,6 @@
175175 * Allow extensions to modify the user creation form by calling addInputItem();
176176 * Add meta generator tag to HTML output
177177 * Two new hooks, ExtendJSGlobalVars and wfMessageCacheReplace added
178 -* New global function, wfSharedTable - used to get the name of a table in the
179 - shared database ($wgSharedDB)
180178
181179 === Bug fixes in 1.13 ===
182180

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36804Two new hooks and one new global function from Wikia codebaseashley08:42, 30 June 2008

Status & tagging log