Before the introduction of ObjectCacheFactory (ref. T358346: Introduce ObjectCacheFactory to MediaWiki core), we use to have 2 ways of constructing and getting BagOStuff cache instances:
- Through ObjectCache::getInstance() via code in PHP like in MediaWiki extensions etc;
- Through the $wgObjectCaches configuration/setting with a 'factory' => [ 'ObjectCache', 'getInstance' ] pattern.
As seen above, (2) is declarative and mostly happens in wmf-config where we declare the factory method to be called/invoked for a particular cache key. After the attempt of migrating ObjectCache to a proper factory and moving most things to service wiring, we have only 1 usage of the declarative pattern left (ref. https://codesearch.wmcloud.org/search/?q=%5C%27ObjectCache%5C%27%5C%2C+%5C%27getInstance%5C%27&files=&excludeFiles=&repos=), which is used by MultiWriteBagOStuff in mediawiki-config.
While we're in the process of deprecating and removing the ObjectCache class, we need a way for ObjectCacheFactory to still support the declarative pattern so that the MultiWriteBagOStuff config in $wgObjectCaches continues to work like today. @Krinkle pointed this out on a patch (ref. https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1068959) which as a result of that caused this task to be created.
Acceptance Criteria
- Introduce a mechanism for ObjectCacheFactory to declare a method for $wgObjectCaches to use in constructing MultiWriteBagOStuff in mediawiki-config
- Migrate https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/4f2946289aa529886aef9254f5946f44eb5418c7/wmf-config/CommonSettings.php#617 to use the new code
- Confirm that the migration works after deployment