r41239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41238‎ | r41239 | r41240 >
Date:20:30, 24 September 2008
Author:aaron
Status:old
Tags:
Comment:
* Rename randomInsert() to insertToDefault()
* Use insertToDefault() to insert revisions (talked to brion on this)
Modified paths:
  • /trunk/phase3/includes/ExternalStore.php (modified) (history)
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Revision.php
@@ -762,18 +762,8 @@
763763
764764 # Write to external storage if required
765765 if ( $wgDefaultExternalStore ) {
766 - if ( is_array( $wgDefaultExternalStore ) ) {
767 - // Distribute storage across multiple clusters
768 - $store = $wgDefaultExternalStore[mt_rand(0, count( $wgDefaultExternalStore ) - 1)];
769 - } else {
770 - $store = $wgDefaultExternalStore;
771 - }
772766 // Store and get the URL
773 - $data = ExternalStore::insert( $store, $data );
774 - if ( !$data ) {
775 - # This should only happen in the case of a configuration error, where the external store is not valid
776 - throw new MWException( "Unable to store text to external storage $store" );
777 - }
 767+ $data = ExternalStore::insertToDefault( $data );
778768 if ( $flags ) {
779769 $flags .= ',';
780770 }
Index: trunk/phase3/includes/ExternalStore.php
@@ -75,7 +75,7 @@
7676 * @param string $data
7777 * Returns the URL of the stored data item, or false on error
7878 */
79 - public static function randomInsert( $data ) {
 79+ public static function insertToDefault( $data ) {
8080 global $wgDefaultExternalStore;
8181 $tryStores = (array)$wgDefaultExternalStore;
8282 $error = false;