Couple more userid properties for Bug 19195
[lhc/web/wiklou.git] / includes / api / ApiQueryExtLinksUsage.php
index c17f0af..7205a78 100644 (file)
@@ -1,10 +1,9 @@
 <?php
-
 /**
- * Created on July 7, 2007
- *
  * API for MediaWiki 1.8+
  *
+ * Created on July 7, 2007
+ *
  * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -41,6 +42,10 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                $this->run();
        }
 
+       public function getCacheMode( $params ) {
+               return 'public';
+       }
+
        public function executeGenerator( $resultPageSet ) {
                $this->run( $resultPageSet );
        }
@@ -113,7 +118,7 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
 
                $result = $this->getResult();
                $count = 0;
-               while ( $row = $db->fetchObject( $res ) ) {
+               foreach ( $res as $row ) {
                        if ( ++ $count > $limit ) {
                                // We've reached the one extra which shows that there are additional pages to be had. Stop here...
                                $this->setContinueEnumParameter( 'offset', $offset + $limit );
@@ -190,7 +195,12 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
        public function getParamDescription() {
                $p = $this->getModulePrefix();
                return array(
-                       'prop' => 'What pieces of information to include',
+                       'prop' => array(
+                               'What pieces of information to include',
+                               ' ids    - Adds the id of page',
+                               ' title  - Adds the title and namespace id of the page',
+                               ' url    - Adds the URL used in the page',
+                       ),
                        'offset' => 'Used for paging. Use the value returned for "continue"',
                        'protocol' => array(
                                "Protocol of the url. If empty and {$p}query set, the protocol is http.",
@@ -221,4 +231,4 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
-}
\ No newline at end of file
+}