From: Max Semenik Date: Fri, 18 Jun 2010 19:39:08 +0000 (+0000) Subject: Fixed hit counter on SQLite X-Git-Tag: 1.31.0-rc.0~36472 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=edc40d10faa63ad6d20e93505e48d0ae2904c745;p=lhc%2Fweb%2Fwiklou.git Fixed hit counter on SQLite --- diff --git a/includes/Article.php b/includes/Article.php index 9dc80741ec..862a81bf30 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -4048,8 +4048,9 @@ class Article { $pageTable = $dbw->tableName( 'page' ); $hitcounterTable = $dbw->tableName( 'hitcounter' ); $acchitsTable = $dbw->tableName( 'acchits' ); + $dbType = $dbw->getType(); - if ( $wgHitcounterUpdateFreq <= 1 ) { + if ( $wgHitcounterUpdateFreq <= 1 || $dbType == 'sqlite' ) { $dbw->query( "UPDATE $pageTable SET page_counter = page_counter + 1 WHERE page_id = $id" ); return; @@ -4076,7 +4077,6 @@ class Article { wfProfileIn( 'Article::incViewCount-collect' ); $old_user_abort = ignore_user_abort( true ); - $dbType = $dbw->getType(); $dbw->lockTables( array(), array( 'hitcounter' ), __METHOD__, false ); $tabletype = $dbType == 'mysql' ? "ENGINE=HEAP " : ''; $dbw->query( "CREATE TEMPORARY TABLE $acchitsTable $tabletype AS " .