There's an implementation in SyntaxHighlight, TrustedXFF, and core's LCStoreStaticArray. They all differ slightly, and given that we're moving away from CDB to static PHP arrays, we should have a single implementation in core that can be reused.
|cdb : master||Add Cdb\Writer\Hash implementation|
|mediawiki/core : master||Use StaticArrayWriter in LCStoreStaticArray|
|mediawiki/core : master||Support nested arrays in StaticArrayWriter|
|mediawiki/core : master||Remove wfMakeStaticArrayFile()|
|mediawiki/extensions/SecureLinkFixer : master||Use StaticArrayWriter class|
|mediawiki/core : master||Move wfMakeStaticArrayFile() into a class|
|mediawiki/extensions/SyntaxHighlight_GeSHi : master||Use StaticArrayWriter class|
|mediawiki/extensions/SyntaxHighlight_GeSHi : master||Use wfMakeStaticArrayFile()|
|mediawiki/extensions/TrustedXFF : REL1_30||Run str_replace on a string|
|mediawiki/extensions/TrustedXFF : REL1_31||Run str_replace on a string|
|mediawiki/extensions/TrustedXFF : master||Run str_replace on a string|
|Open||None||T212460 Adopt static array files for local disk storage of values (tracking)|
|Resolved||Legoktm||T200626 Standardize on a single PHP static array writer implementation|
There's an implementation in SyntaxHighlight, TrustedXFF, and core's LCStaticArray.
Also mediawiki-extensions-WikimediaMaintenance:/dumpInterwiki.php, and as of recent wfMakeStaticArrayFile() in MediaWiki core as used by maintenance/generateNormalizerDataMl.php.
Oh, I forgot about wfMakeStaticArrayFile. I think that meets my needs. Theoretically we could put it in the cdb library to match \Cdb\Reader\Hash, but that seems weird since it has nothing to do with cdb.
Tagging as a 1.32 release blocker to clarify on whether we want to librarize this (in cdb, or maybe something else) or whether we're ok with wfMakeStaticArrayFile() becoming a stable interface.
@Legoktm Aye, I apologise for including a new global function in 2018. It looked so nice alongside the wfGetPrecompiledData() function I was replacing at https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/434040/6/includes/GlobalFunctions.php.
Let's at least make it an autoloaded class rather than a global function before this becomes a stable release.