function getPageWideStats($results) { global $wgMemc; wfProfileIn(__METHOD__); $key = wfMemcKey("rcbuddy_pagewidestats"); $result = $wgMemc->get($key); if (is_array($result)) { wfProfileOut(__METHOD__); return array_merge($results, $result); } $dbr = wfGetDB(DB_SLAVE); $newstuff = array(); $count = $dbr->selectField(array('recentchanges'), array('count(*) as c'), array('rc_patrolled=0'), __METHOD__); $newstuff['unpatrolled_total'] = $count; $t = gmdate("YmdHis", time() - 60 * 30); // thirty minutes ago $row = $dbr->selectRow(array('recentchanges'), array('count(distinct(rc_user)) as c'), array("rc_timestamp > {$t}", 'rc_user > 0'), __METHOD__); $count = $row->c; $newstuff['users_editing'] = $count; $nab_unpatrolled = Newarticleboost::getNABCount($dbr); $newstuff['nab_unpatrolled'] = $nab_unpatrolled; $wgMemc->set($key, $newstuff, 60); wfProfileOut(__METHOD__); return array_merge($newstuff, $results); }
public function getCount(&$dbr) { return Newarticleboost::getNABCount($dbr); }