4cd573f44e2b32b34b27cc3016e33e0dc3afbcac
[lhc/web/wiklou.git] / includes / ViewCountUpdate.php
1 <?php
2 # $Id$
3 /**
4 * See deferred.doc
5 */
6
7 /**
8 *
9 */
10 class ViewCountUpdate {
11
12 var $mPageID;
13
14 /**
15 *
16 */
17 function ViewCountUpdate( $pageid ) {
18 $this->mPageID = $pageid;
19 }
20
21 /**
22 *
23 */
24 function doUpdate() {
25 global $wgDisableCounters;
26 if ( $wgDisableCounters ) { return; }
27 $db =& wfGetDB( DB_MASTER );
28 $lowpri = $db->lowPriorityOption();
29 $sql = "UPDATE $lowpri cur SET cur_counter=(1+cur_counter)," .
30 "cur_timestamp=cur_timestamp WHERE cur_id={$this->mPageID}";
31 $res = $db->query( $sql, "ViewCountUpdate::doUpdate" );
32 }
33 }
34 ?>