adrianheine added a comment.
On a general note, I think it makes more sense to be much more flexible about
this. I don't get why we don't support something like the following:
$wgWBSettings[ 'dataTypes' ][] = new FileDataTypeFactory( $someRootScope
)->getForeignAPIRepoFileDataType( 'my-media', array(
'name' => 'commonswiki', // Must be a distinct name
'apibase' => 'https://commons.wikimedia.org/w/api.php',
'hashLevels' => 2
) ); // => array(
// 'DataType' => new DataType( 'my-media', 'string', array() ),
// 'Validator' => new SomeGreatForeignAPIRepoFileDataTypeValidator(),
// 'Expert' => 'de.adrianheine.myproject.MyMediaExpert' //optional,
resource loader module name
// 'Formatter' => new SomeGreatForeignAPIRepoFileDataTypeFormatter(
$allTheSettingsItNeeds ),
// 'Parser' => new StringParserOrWhateverItsCalled(),
// … other cool stuff we need for actually implementing a new data type
// );
This could have different levels of customizability which don't need to be
available at once. The main issue, though, is that we don't even support the
most basic level of configuration: Specifying the data types. If we would just
do that, a lot of problems would not be about introducing new arbitrary
configuration options, but instead be about improving re-usability and
composability of our code.
TASK DETAIL
https://phabricator.wikimedia.org/T90492
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign
<username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: despens, adrianheine
Cc: Snaterlicious, adrianheine, Ricordisamoa, gerritbot, daniel, Aklapper,
Wikidata-bugs, aude
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs