'watchlist',
'COUNT(*)',
array(
+ 'wl_namespace' => $title->getNamespace(),
'wl_title' => $title->getDBkey(),
- 'wl_namespace' => $title->getNamespace()
),
__METHOD__
);
array( 'rev_page' => $id ),
__METHOD__
);
+ $result = array( 'watchers' => $watchers, 'edits' => $edits,
+ 'authors' => $authors );
- $views = (int)$dbr->selectField(
- 'page',
- 'page_counter',
- array( 'page_id' => $id ),
- __METHOD__
- );
-
- return array( 'watchers' => $watchers, 'edits' => $edits,
- 'authors' => $authors, 'views' => $views );
+ global $wgDisableCounters;
+ if ( !$wgDisableCounters ) {
+ $views = (int)$dbr->selectField(
+ 'page',
+ 'page_counter',
+ array( 'page_id' => $id ),
+ __METHOD__
+ );
+ $result['views'] = $views;
+ }
+
+ return $result;
}
}