http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72818
Revision: 72818
Author: nikerabbit
Date: 2010-09-11 15:55:02 +0000 (Sat, 11 Sep 2010)
Log Message:
-----------
Canonical case for function and whitespace fixes
Modified Paths:
--------------
trunk/phase3/includes/MessageBlobStore.php
Modified: trunk/phase3/includes/MessageBlobStore.php
===================================================================
--- trunk/phase3/includes/MessageBlobStore.php 2010-09-11 15:50:42 UTC (rev
72817)
+++ trunk/phase3/includes/MessageBlobStore.php 2010-09-11 15:55:02 UTC (rev
72818)
@@ -70,7 +70,7 @@
return false;
}
- $dbw = wfGetDb( DB_MASTER );
+ $dbw = wfGetDB( DB_MASTER );
$success = $dbw->insert( 'msg_resource', array(
'mr_lang' => $lang,
'mr_resource' => $module,
@@ -121,8 +121,9 @@
$retval = null;
// Find all existing blobs for this module
- $dbw = wfGetDb( DB_MASTER );
- $res = $dbw->select( 'msg_resource', array( 'mr_lang',
'mr_blob' ),
+ $dbw = wfGetDB( DB_MASTER );
+ $res = $dbw->select( 'msg_resource',
+ array( 'mr_lang', 'mr_blob' ),
array( 'mr_resource' => $module ),
__METHOD__
);
@@ -191,7 +192,7 @@
* @param $key string Message key
*/
public static function updateMessage( $key ) {
- $dbw = wfGetDb( DB_MASTER );
+ $dbw = wfGetDB( DB_MASTER );
// Keep running until the updates queue is empty.
// Due to update conflicts, the queue might not be emptied
@@ -205,9 +206,11 @@
// didn't change since we fetched it by putting
// the timestamp in the WHERE clause.
$success = $dbw->update( 'msg_resource',
- array( 'mr_blob' => $update['newBlob'],
+ array(
+ 'mr_blob' => $update['newBlob'],
'mr_timestamp' =>
$dbw->timestamp() ),
- array( 'mr_resource' =>
$update['resource'],
+ array(
+ 'mr_resource' =>
$update['resource'],
'mr_lang' => $update['lang'],
'mr_timestamp' =>
$update['timestamp'] ),
__METHOD__
@@ -230,7 +233,7 @@
public static function clear() {
// TODO: Give this some more thought
// TODO: Is TRUNCATE better?
- $dbw = wfGetDb( DB_MASTER );
+ $dbw = wfGetDB( DB_MASTER );
$dbw->delete( 'msg_resource', '*', __METHOD__ );
$dbw->delete( 'msg_resource_links', '*', __METHOD__ );
}
@@ -242,14 +245,14 @@
* @return array Updates queue
*/
private static function getUpdatesForMessage( $key, $prevUpdates = null
) {
- $dbw = wfGetDb( DB_MASTER );
+ $dbw = wfGetDB( DB_MASTER );
if ( is_null( $prevUpdates ) ) {
// Fetch all blobs referencing $key
$res = $dbw->select(
- array( 'msg_resource', 'msg_resource_links' ),
- array( 'mr_resource', 'mr_lang', 'mr_blob',
'mr_timestamp' ),
- array( 'mrl_message' => $key,
'mr_resource=mrl_resource' ),
+ array( 'msg_resource', 'msg_resource_links' ),
+ array( 'mr_resource', 'mr_lang', 'mr_blob',
'mr_timestamp' ),
+ array( 'mrl_message' => $key,
'mr_resource=mrl_resource' ),
__METHOD__
);
} else {
@@ -264,7 +267,7 @@
}
$res = $dbw->select( 'msg_resource',
- array( 'mr_resource', 'mr_lang', 'mr_blob',
'mr_timestamp' ),
+ array( 'mr_resource', 'mr_lang', 'mr_blob',
'mr_timestamp' ),
$dbw->makeWhereFrom2d( $twoD, 'mr_resource',
'mr_lang' ),
__METHOD__
);
@@ -278,8 +281,7 @@
'resource' => $row->mr_resource,
'lang' => $row->mr_lang,
'timestamp' => $row->mr_timestamp,
- 'newBlob' => self::reencodeBlob( $row->mr_blob,
- $key, $row->mr_lang )
+ 'newBlob' => self::reencodeBlob( $row->mr_blob,
$key, $row->mr_lang )
);
}
@@ -310,7 +312,8 @@
private static function getFromDB( $modules, $lang ) {
$retval = array();
$dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select( 'msg_resource', array( 'mr_blob',
'mr_resource', 'mr_timestamp' ),
+ $res = $dbr->select( 'msg_resource',
+ array( 'mr_blob', 'mr_resource', 'mr_timestamp' ),
array( 'mr_resource' => $modules, 'mr_lang' => $lang ),
__METHOD__
);
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs