29 parent::__construct( $query, $moduleName,
'pp' );
30 $this->pageProps = $pageProps;
34 # Only operate on existing pages
38 if ( $params[
'continue'] ) {
40 $continueValue = $cont[0];
42 foreach ( $pages as $id => $page ) {
43 if ( $id >= $continueValue ) {
44 $filteredPages[$id] = $page;
47 $pages = $filteredPages;
50 if ( $pages === [] ) {
55 if ( $params[
'prop'] ) {
56 $properties = $this->pageProps->getProperties( $pages, $params[
'prop'] );
58 $properties = $this->pageProps->getAllProperties( $pages );
64 foreach ( $properties as $pageid => $props ) {
65 if ( !$this->addPageProps( $result, $pageid, $props ) ) {
80 private function addPageProps( $result, $page, $props ) {
82 $fit = $result->addValue( [
'query',
'pages', $page ],
'pageprops', $props );
103 ParamValidator::PARAM_ISMULTI =>
true,
110 $title = Title::newMainPage()->getPrefixedText();
111 $mp = rawurlencode( $title );
114 "action=query&prop=pageprops&titles={$mp}|MediaWiki"
115 =>
'apihelp-query+pageprops-example-simple',
121 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Pageprops';
126class_alias( ApiQueryPageProps::class,
'ApiQueryPageProps' );
A query module to show basic page information.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
getHelpUrls()
Return links to more detailed help pages about the module.1.25, returning boolean false is deprecated...
getExamplesMessages()
Returns usage examples for this module.Return value has query strings as keys, with values being eith...
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
__construct(ApiQuery $query, string $moduleName, PageProps $pageProps)
getCacheMode( $params)
Get the cache mode for the data generated by this module.Override this in the module subclass....
Gives access to properties of a page.