Add support for Number grouping(commafy) based on CLDR number grouping patterns like...
[lhc/web/wiklou.git] / includes / SiteStats.php
index 09b0fd0..e9137fe 100644 (file)
@@ -220,9 +220,9 @@ class SiteStats {
 }
 
 /**
- *
+ * Class for handling updates to the site_stats table
  */
-class SiteStatsUpdate {
+class SiteStatsUpdate implements DeferrableUpdate {
 
        var $mViews, $mEdits, $mGood, $mPages, $mUsers;
 
@@ -325,7 +325,7 @@ class SiteStatsInit {
                if ( $database instanceof DatabaseBase ) {
                        $this->db = $database;
                } else {
-                       $this->db = wfGetDB( $useMaster ? DB_MASTER : DB_SLAVE );
+                       $this->db = wfGetDB( $database ? DB_MASTER : DB_SLAVE );
                }
        }
 
@@ -377,7 +377,7 @@ class SiteStatsInit {
                $this->mPages = $this->db->selectField( 'page', 'COUNT(*)', '', __METHOD__ );
                return $this->mPages;
        }
-       
+
        /**
         * Count total users
         * @return Integer
@@ -386,7 +386,7 @@ class SiteStatsInit {
                $this->mUsers = $this->db->selectField( 'user', 'COUNT(*)', '', __METHOD__ );
                return $this->mUsers;
        }
-       
+
        /**
         * Count views
         * @return Integer
@@ -407,7 +407,7 @@ class SiteStatsInit {
 
        /**
         * Do all updates and commit them. More or less a replacement
-        * for the original initStats, but without the calls to wfOut()
+        * for the original initStats, but without output.
         *
         * @param $database Boolean or DatabaseBase:
         * - Boolean: whether to use the master DB