CirrusSearch.php is not designed to be used in a migration script that will generate extension.php automatically. Several problems exist in this file that should be resolved first.
dynamic settings
$wgCirrusSearchIndexBaseName = wfWikiID();
These dynamic config var will be resolved at migration with a default value like:
"CirrusSearchIndexBaseName": { "value": "wikidb-mw_" },
Unless there is a way to support "dynamic" with extension.json, we should remove this line from CirrusSearch.php and defer setting wgCirrusSearchIndexBaseName in the code when unset.
code/registry/factory setup
Sometimes with use php constants, these are also resolved by the migration script and become hard to read :
/** * Mapping of result types to CirrusSearch classes. */ $wgCirrusSearchFieldTypes = array( SearchIndexField::INDEX_TYPE_TEXT => \CirrusSearch\Search\TextIndexField::class, SearchIndexField::INDEX_TYPE_KEYWORD => \CirrusSearch\Search\KeywordIndexField::class, [...] );
will become:
"CirrusSearchFieldTypes": { "value": { "0": "CirrusSearch\\Search\\TextIndexField", "1": "CirrusSearch\\Search\\KeywordIndexField", [...] } },
Maybe moving this into an extension hook would be appropriate.