summaryrefslogtreecommitdiff
path: root/includes/api/ApiQueryRandom.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
commit1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch)
treef1fdd326034e05177596851be6a7127615d81498 /includes/api/ApiQueryRandom.php
parent9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff)
parentf6d65e533c62f6deb21342d4901ece24497b433e (diff)
Merge commit 'f6d65'
# Conflicts: # skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/api/ApiQueryRandom.php')
-rw-r--r--includes/api/ApiQueryRandom.php27
1 files changed, 6 insertions, 21 deletions
diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php
index 530557e6..a2c28443 100644
--- a/includes/api/ApiQueryRandom.php
+++ b/includes/api/ApiQueryRandom.php
@@ -131,7 +131,7 @@ class ApiQueryRandom extends ApiQueryGeneratorBase {
}
if ( is_null( $resultPageSet ) ) {
- $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'page' );
+ $result->addIndexedTagName( array( 'query', $this->getModuleName() ), 'page' );
}
}
@@ -165,30 +165,15 @@ class ApiQueryRandom extends ApiQueryGeneratorBase {
);
}
- public function getParamDescription() {
+ protected function getExamplesMessages() {
return array(
- 'namespace' => 'Return pages in these namespaces only',
- 'limit' => 'Limit how many random pages will be returned',
- 'redirect' => 'Load a random redirect instead of a random page'
+ 'action=query&list=random&rnnamespace=0&rnlimit=2'
+ => 'apihelp-query+random-example-simple',
+ 'action=query&generator=random&grnnamespace=0&grnlimit=2&prop=info'
+ => 'apihelp-query+random-example-generator',
);
}
- public function getDescription() {
- return array(
- 'Get a set of random pages.',
- 'NOTE: Pages are listed in a fixed sequence, only the starting point is random.',
- ' This means that if, for example, "Main Page" is the first random page on',
- ' your list, "List of fictional monkeys" will *always* be second, "List of',
- ' people on stamps of Vanuatu" third, etc.',
- 'NOTE: If the number of pages in the namespace is lower than rnlimit, you will',
- ' get fewer pages. You will not get the same page twice.'
- );
- }
-
- public function getExamples() {
- return 'api.php?action=query&list=random&rnnamespace=0&rnlimit=2';
- }
-
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Random';
}