Remove --max-slave-lag options and remnants from maintenance scripts
[lhc/web/wiklou.git] / includes / api / ApiQueryExtLinksUsage.php
index 33e8739..e77355b 100644 (file)
@@ -145,7 +145,7 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
        }
 
        public function getAllowedParams() {
-               return array(
+               $ret = array(
                        'prop' => array(
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_DFLT => 'ids|title|url',
@@ -156,7 +156,8 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                                )
                        ),
                        'offset' => array(
-                               ApiBase::PARAM_TYPE => 'integer'
+                               ApiBase::PARAM_TYPE => 'integer',
+                               ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
                        ),
                        'protocol' => array(
                                ApiBase::PARAM_TYPE => self::prepareProtocols(),
@@ -176,6 +177,14 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                        ),
                        'expandurl' => false,
                );
+
+               if ( $this->getConfig()->get( 'MiserMode' ) ) {
+                       $ret['namespace'][ApiBase::PARAM_HELP_MSG_APPEND] = array(
+                               'api-help-param-limited-in-miser-mode',
+                       );
+               }
+
+               return $ret;
        }
 
        public static function prepareProtocols() {
@@ -207,66 +216,10 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                }
        }
 
-       public function getParamDescription() {
-               $p = $this->getModulePrefix();
-               $desc = array(
-                       '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.",
-                               "Leave both this and {$p}query empty to list all external links"
-                       ),
-                       'query' => 'Search string without protocol. See [[Special:LinkSearch]]. ' .
-                               'Leave empty to list all external links',
-                       'namespace' => 'The page namespace(s) to enumerate.',
-                       'limit' => 'How many pages to return.',
-                       'expandurl' => 'Expand protocol-relative URLs with the canonical protocol',
-               );
-
-               if ( $this->getConfig()->get( 'MiserMode' ) ) {
-                       $desc['namespace'] = array(
-                               $desc['namespace'],
-                               "NOTE: Due to \$wgMiserMode, using this may result in fewer than \"{$p}limit\" results",
-                               'returned before continuing; in extreme cases, zero results may be returned',
-                       );
-               }
-
-               return $desc;
-       }
-
-       public function getResultProperties() {
-               return array(
-                       'ids' => array(
-                               'pageid' => 'integer'
-                       ),
-                       'title' => array(
-                               'ns' => 'namespace',
-                               'title' => 'string'
-                       ),
-                       'url' => array(
-                               'url' => 'string'
-                       )
-               );
-       }
-
-       public function getDescription() {
-               return 'Enumerate pages that contain a given URL.';
-       }
-
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'bad_query', 'info' => 'Invalid query' ),
-               ) );
-       }
-
-       public function getExamples() {
+       protected function getExamplesMessages() {
                return array(
-                       'api.php?action=query&list=exturlusage&euquery=www.mediawiki.org'
+                       'action=query&list=exturlusage&euquery=www.mediawiki.org'
+                               => 'apihelp-query+exturlusage-example-simple',
                );
        }