Lucas_Werkmeister_WMDE added a subscriber: Addshore.
Lucas_Werkmeister_WMDE added a comment.

I’m a bit confused about the use of MediaWikiServices there. Consider the following snippet of Cognate’s ServiceWiring.php:

	'CognateRepo' => function ( MediaWikiServices $services ) {
		$repo = new CognateRepo(
			CognateServices::getStore(),
			CognateServices::getCacheInvalidator(),
			$services->getTitleFormatter(),
			CognateServices::getLogger()
		);
		$repo->setStatsdDataFactory( $services->getStatsdDataFactory() );
		return $repo;
	},

This function uses the CognateServices utility methods to get some other services which, ultimately, are also declared in ServiceWiring.php. But those utility methods always use MediaWikiServices::getInstance(), not the $services passed into the CognateRepo callback. So as far as I can tell, it’s possible that CognateRepo contains a mixture of service from two different service locators – the default one, and whatever was passed into the callback. Isn’t that a problem?

@Addshore perhaps you can comment on this? It looks like you were the main person to work on MediaWikiServices in Cognate.


TASK DETAIL
https://phabricator.wikimedia.org/T196053

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Addshore, Lucas_Werkmeister_WMDE, Aklapper, Ladsgroup, Lahi, Gq86, GoranSMilovanovic, Jayprakash12345, QZanden, LawExplorer, Agabi10, Wikidata-bugs, aude, Dinoguy1000, Lydia_Pintscher, Mbch331, Jay8g
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to