<?php
/**
- * API for MediaWiki 1.8+
+ *
*
* Created on Sep 25, 2006
*
parent::__construct( $query, $moduleName, 'in' );
}
+ /**
+ * @param $pageSet ApiPageSet
+ * @return void
+ */
public function requestExtraData( $pageSet ) {
- global $wgDisablePageCounters;
+ global $wgDisableCounters;
$pageSet->requestField( 'page_restrictions' );
$pageSet->requestField( 'page_is_redirect' );
$pageSet->requestField( 'page_is_new' );
- if ( !$wgDisablePageCounters ) {
+ if ( !$wgDisableCounters ) {
$pageSet->requestField( 'page_counter' );
}
$pageSet->requestField( 'page_touched' );
$this->pageIsRedir = $pageSet->getCustomField( 'page_is_redirect' );
$this->pageIsNew = $pageSet->getCustomField( 'page_is_new' );
- global $wgDisablePageCounters;
+ global $wgDisableCounters;
- if ( !$wgDisablePageCounters ) {
+ if ( !$wgDisableCounters ) {
$this->pageCounter = $pageSet->getCustomField( 'page_counter' );
}
$this->pageTouched = $pageSet->getCustomField( 'page_touched' );
private function extractPageInfo( $pageid, $title ) {
$pageInfo = array();
if ( $title->exists() ) {
- global $wgDisablePageCounters;
+ global $wgDisableCounters;
$pageInfo['touched'] = wfTimestamp( TS_ISO_8601, $this->pageTouched[$pageid] );
$pageInfo['lastrevid'] = intval( $this->pageLatest[$pageid] );
- $pageInfo['counter'] = $wgDisablePageCounters
+ $pageInfo['counter'] = $wgDisableCounters
? ""
: intval( $this->pageCounter[$pageid] );
$pageInfo['length'] = intval( $this->pageLength[$pageid] );
private function getWatchedInfo() {
global $wgUser;
- if ( $wgUser->isAnon() || count( $this->titles ) == 0 ) {
+ if ( $wgUser->isAnon() || count( $this->everything ) == 0 ) {
return;
}
$this->watched = array();
$db = $this->getDB();
- $lb = new LinkBatch( $this->titles );
+ $lb = new LinkBatch( $this->everything );
$this->resetQueryParams();
- $this->addTables( array( 'page', 'watchlist' ) );
- $this->addFields( array( 'page_title', 'page_namespace' ) );
+ $this->addTables( array( 'watchlist' ) );
+ $this->addFields( array( 'wl_title', 'wl_namespace' ) );
$this->addWhere( array(
- $lb->constructSet( 'page', $db ),
- 'wl_namespace=page_namespace',
- 'wl_title=page_title',
+ $lb->constructSet( 'wl', $db ),
'wl_user' => $wgUser->getID()
) );
$res = $this->select( __METHOD__ );
foreach ( $res as $row ) {
- $this->watched[$row->page_namespace][$row->page_title] = true;
+ $this->watched[$row->wl_namespace][$row->wl_title] = true;
}
}