I'm experimenting with extension.json [0], the callback is the earliest possible function to set our global SMW_VERSION to an actual version expected to be maintained in extension.json but by the time callback is initialized we are unable to have access to the version because the queue hasn't finished processing.
}, "callback": "SemanticMediaWiki::initExtension", "ExtensionFunctions": [ "SemanticMediaWiki::onExtensionFunction" ],
$extensionData = ExtensionRegistry::getInstance()->getAllThings(); if ( isset( $extensionData['SemanticMediaWiki']['version'] ) ) { $version = $extensionData['SemanticMediaWiki']['version']; }
I'd like to avoid any reference to ExtensionRegistry in our repository and instead have access to the configuration in the initExtension callback such as:
public static function initExtension( $configuration ) { define( 'SMW_VERSION', $configuration['version'] ); }
[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1732