Page MenuHomePhabricator

Support using a defined version in extension registration
Closed, DeclinedPublic


Steps to reproduce

Actual results

  • You carn't use a defined version in extension registration you have to set it manually.

Expected results

  • You should be able to use a defined version

for example on how it should look.

"versiondefine:" "Example::Example, "SF_VERSION"

the hook where it is defined and then what it should look for in define.

I am not sure if this way is support in json there may be another way.

Notice instead of using "version" we are using a "versiondefine" instead.

@Legoktm what do you think.

Some extensions such as wikibase do this.

I think proper define support needs to be added.

Event Timeline

Paladox raised the priority of this task from to Needs Triage.
Paladox updated the task description. (Show Details)
Paladox added subscribers: Paladox, Legoktm.

When I surveyed extensions during the initial implementation time, the main usage of these constants was to check whether an extension was installed via if ( defined( 'NAME_VERSION' ) ) { ... } or something. For that use case, we introduced ExtensionRegistry::getInstance()->isLoaded( 'Name' ).

Are there any other use cases of version constants that aren't supported?

Per lack of use cases.