From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/ViewCountUpdate.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'includes/ViewCountUpdate.php') diff --git a/includes/ViewCountUpdate.php b/includes/ViewCountUpdate.php index a30b0f79..28ba3414 100644 --- a/includes/ViewCountUpdate.php +++ b/includes/ViewCountUpdate.php @@ -48,8 +48,7 @@ class ViewCountUpdate implements DeferrableUpdate { $dbw = wfGetDB( DB_MASTER ); if ( $wgHitcounterUpdateFreq <= 1 || $dbw->getType() == 'sqlite' ) { - $pageTable = $dbw->tableName( 'page' ); - $dbw->query( "UPDATE $pageTable SET page_counter = page_counter + 1 WHERE page_id = {$this->id}" ); + $dbw->update( 'page', array( 'page_counter = page_counter + 1' ), array( 'page_id' => $this->id ), __METHOD__ ); return; } @@ -71,10 +70,7 @@ class ViewCountUpdate implements DeferrableUpdate { $dbw = wfGetDB( DB_MASTER ); - $hitcounterTable = $dbw->tableName( 'hitcounter' ); - $res = $dbw->query( "SELECT COUNT(*) as n FROM $hitcounterTable" ); - $row = $dbw->fetchObject( $res ); - $rown = intval( $row->n ); + $rown = $dbw->selectField( 'hitcounter', 'COUNT(*)', array(), __METHOD__ ); if ( $rown < $wgHitcounterUpdateFreq ) { return; @@ -87,6 +83,7 @@ class ViewCountUpdate implements DeferrableUpdate { $dbType = $dbw->getType(); $tabletype = $dbType == 'mysql' ? "ENGINE=HEAP " : ''; + $hitcounterTable = $dbw->tableName( 'hitcounter' ); $acchitsTable = $dbw->tableName( 'acchits' ); $pageTable = $dbw->tableName( 'page' ); -- cgit v1.2.2