'version' => $params['metadataversion'],
'language' => $params['extmetadatalanguage'],
'multilang' => $params['extmetadatamultilang'],
+ 'extmetadatafilter' => $params['extmetadatafilter'],
);
$pageIds = $this->getPageSet()->getAllTitlesByNamespace();
'version' => $metadataOpts ?: 'latest',
'language' => $wgContLang,
'multilang' => false,
+ 'extmetadatafilter' => array(),
);
}
$version = $metadataOpts['version'];
$format->setSingleLanguage( !$metadataOpts['multilang'] );
$format->getContext()->setLanguage( $metadataOpts['language'] );
$extmetaArray = $format->fetchExtendedMetadata( $file );
+ if ( $metadataOpts['extmetadatafilter'] ) {
+ $extmetaArray = array_intersect_key(
+ $extmetaArray, array_flip( $metadataOpts['extmetadatafilter'] )
+ );
+ }
$vals['extmetadata'] = $extmetaArray;
}
ApiBase::PARAM_TYPE => 'boolean',
ApiBase::PARAM_DFLT => false,
),
+ 'extmetadatafilter' => array(
+ ApiBase::PARAM_TYPE => 'string',
+ ApiBase::PARAM_ISMULTI => true,
+ ),
'urlparam' => array(
ApiBase::PARAM_DFLT => '',
ApiBase::PARAM_TYPE => 'string',
'translation to fetch, if multiple are available, as well as how things',
'like numbers and various values are formatted.' ),
'extmetadatamultilang' => 'If translations for extmetadata property are available, fetch all of them.',
+ 'extmetadatafilter' => "If specified and non-empty, only these keys will be returned for {$p}prop=extmetadata",
'continue' => 'If the query response includes a continue value, use it here to get another page of results',
'localonly' => 'Look only for files in the local repository',
);