30 parent::__construct( $query, $moduleName,
'fri' );
37 $props = array_fill_keys( $params[
'prop'],
true );
43 $this->repoGroup->forEachForeignRepo(
44 static function (
FileRepo $repo ) use ( &$repos, $props, $foreignTargets ) {
46 $repoProps[
'canUpload'] = in_array( $repoProps[
'name'], $foreignTargets );
48 $repos[] = array_intersect_key( $repoProps, $props );
52 $localInfo = $this->repoGroup->getLocalRepo()->getInfo();
54 $repos[] = array_intersect_key( $localInfo, $props );
60 $result->addValue( [
'query' ],
'repos', $repos );
74 ParamValidator::PARAM_DEFAULT => implode(
'|', $props ),
75 ParamValidator::PARAM_ISMULTI =>
true,
76 ParamValidator::PARAM_TYPE => $props,
84 $this->repoGroup->forEachForeignRepo(
static function (
FileRepo $repo ) use ( &$props ) {
85 $props = array_merge( $props, array_keys( $repo->
getInfo() ) );
88 $propValues = array_values( array_unique( array_merge(
90 array_keys( $this->repoGroup->getLocalRepo()->getInfo() )
93 $propValues[] =
'canUpload';
103 $props = array_intersect( [
'apiurl',
'name',
'displayname' ], $this->getProps() );
105 $examples[
'action=query&meta=filerepoinfo&friprop=' . implode(
'|', $props )] =
106 'apihelp-query+filerepoinfo-example-simple';
114 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Filerepoinfo';
119class_alias( ApiQueryFileRepoInfo::class,
'ApiQueryFileRepoInfo' );
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()