46 parent::__construct( $query, $moduleName,
'fri' );
47 $this->repoGroup = $repoGroup;
54 $props = array_fill_keys(
$params[
'prop'],
true );
60 $this->repoGroup->forEachForeignRepo(
61 static function (
FileRepo $repo ) use ( &$repos, $props, $foreignTargets ) {
63 $repoProps[
'canUpload'] = in_array( $repoProps[
'name'], $foreignTargets );
65 $repos[] = array_intersect_key( $repoProps, $props );
69 $localInfo = $this->repoGroup->getLocalRepo()->getInfo();
71 $repos[] = array_intersect_key( $localInfo, $props );
77 $result->addValue( [
'query' ],
'repos', $repos );
89 ParamValidator::PARAM_DEFAULT => implode(
'|', $props ),
90 ParamValidator::PARAM_ISMULTI =>
true,
91 ParamValidator::PARAM_TYPE => $props,
99 $this->repoGroup->forEachForeignRepo(
static function (
FileRepo $repo ) use ( &$props ) {
100 $props = array_merge( $props, array_keys( $repo->
getInfo() ) );
103 $propValues = array_values( array_unique( array_merge(
105 array_keys( $this->repoGroup->getLocalRepo()->getInfo() )
108 $propValues[] =
'canUpload';
117 $props = array_intersect( [
'apiurl',
'name',
'displayname' ], $this->
getProps() );
119 $examples[
'action=query&meta=filerepoinfo&friprop=' . implode(
'|', $props )] =
120 'apihelp-query+filerepoinfo-example-simple';
127 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Filerepoinfo';
132class_alias( ApiQueryFileRepoInfo::class,
'ApiQueryFileRepoInfo' );
array $params
The job parameters.
Base class for file repositories.
getInfo()
Return information about the repository.
A class containing constants representing the names of configuration variables.
const ForeignUploadTargets
Name constant for the ForeignUploadTargets setting, for use with Config::get()
const EnableUploads
Name constant for the EnableUploads setting, for use with Config::get()
Prioritized list of file repositories.