changing wfQuery to allow replication
[lhc/web/wiklou.git] / includes / ViewCountUpdate.php
1 <?
2 # See deferred.doc
3
4 class ViewCountUpdate {
5
6 var $mPageID;
7
8 function ViewCountUpdate( $pageid )
9 {
10 $this->mPageID = $pageid;
11 }
12
13 function doUpdate()
14 {
15 global $wgDisableCounters;
16 if ( $wgDisableCounters ) { return; }
17
18 $sql = "UPDATE LOW_PRIORITY cur SET cur_counter=(1+cur_counter)," .
19 "cur_timestamp=cur_timestamp WHERE cur_id={$this->mPageID}";
20 $res = wfQuery( $sql, DB_WRITE, "ViewCountUpdate::doUpdate" );
21 }
22 }
23
24 ?>