* DB_WRITE now called DB_MASTER, DB_READ now called DB_SLAVE * Converted to use SQL wrapper functions instead of direct SQL in various places * Experimental method for preserving the chronological order of events when slave servers are used. Untested. * Fixes to the new post-parse existence test feature * Some.. other stuff
24 lines
503 B
PHP
24 lines
503 B
PHP
<?php
|
|
# $Id$
|
|
# See deferred.doc
|
|
class ViewCountUpdate {
|
|
|
|
var $mPageID;
|
|
|
|
function ViewCountUpdate( $pageid )
|
|
{
|
|
$this->mPageID = $pageid;
|
|
}
|
|
|
|
function doUpdate()
|
|
{
|
|
global $wgDisableCounters;
|
|
if ( $wgDisableCounters ) { return; }
|
|
$db =& wfGetDB( DB_MASTER );
|
|
$lowpri = $db->lowPriorityOption();
|
|
$sql = "UPDATE $lowpri cur SET cur_counter=(1+cur_counter)," .
|
|
"cur_timestamp=cur_timestamp WHERE cur_id={$this->mPageID}";
|
|
$res = $db->query( $sql, "ViewCountUpdate::doUpdate" );
|
|
}
|
|
}
|
|
?>
|