More parameter documentation
[lhc/web/wiklou.git] / includes / api / ApiQueryInfo.php
index 2c7b64a..86c0a58 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * API for MediaWiki 1.8+
+ *
  *
  * Created on Sep 25, 2006
  *
@@ -47,13 +47,17 @@ class ApiQueryInfo extends ApiQueryBase {
                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' );
@@ -250,9 +254,9 @@ class ApiQueryInfo extends ApiQueryBase {
                $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' );
@@ -301,11 +305,11 @@ class ApiQueryInfo extends ApiQueryBase {
        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] );
@@ -593,29 +597,27 @@ class ApiQueryInfo extends ApiQueryBase {
        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;
                }
        }