summaryrefslogtreecommitdiff
path: root/includes/ViewCountUpdate.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /includes/ViewCountUpdate.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
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
Diffstat (limited to 'includes/ViewCountUpdate.php')
-rw-r--r--includes/ViewCountUpdate.php9
1 files changed, 3 insertions, 6 deletions
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' );