You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Flarum assumes that if an extension installs, everything is perfectly fine with it. Additionally, it loads extensions in the order they were enabled. Neither of these are particularly robust. IMO, the following issues should be fixed:
If an extension depends on another flarum extension, it should not be enable-able until its flarum dependencies are enabled.
If an extension has flarum extensions depending on it, it should not be disable-able until its flarum dependencies are disabled
If, during app boot, an enabled extension has a missing flarum dependency, it should not be loaded, and should be marked as disabled (this will not result in an inconsistent state as we don't even TRY to load it).
Enabled extensions should be loaded in such an order that an extension is loaded AFTER its enabled dependencies have been loaded.
Required PHP versions and php extension versions should be obeyed before loading extensions.
Describe the solution you'd like
One way that has been proposed is getting dependencies from the composer.json file. I don't like this for several reasons:
It assumes that the extension is 'compiled' (well more like assembled) on the same machine/environment that the forum is running on.
It assumes that an extension is dependent on all flarum extensions it lists in requires. I have written extensions that 'require' other extensions while not actually depending on their functionality.
The composer.json require list does NOT indicate whether something is a flarum extension. This means that during load, we would need to open and check the composer.json file of every single package required by an extension to make a list of flarum extensions that extension depends on
This further ties us to composer, in a manner where I don't think that's necessary.
I would like to propose that we build in our own method for dependency management. In addition to the extend.php file, we require a flarum-dependencies.php (or flarum-dependencies.json) file, which would list:
PHP version requirements
PHP extension dependencies and version requirements.
Flarum extension dependencies and version requirements.
Flarum extension conflicts and version requirements.
If any of these are omitted, they would be ignored.
This would give us a LOT more robustness in our extension management system.
The text was updated successfully, but these errors were encountered:
Functionality Discussion
Related Discussions:
#1318
#1039
Is your feature request related to a problem? Please describe.
Flarum assumes that if an extension installs, everything is perfectly fine with it. Additionally, it loads extensions in the order they were enabled. Neither of these are particularly robust. IMO, the following issues should be fixed:
Describe the solution you'd like
One way that has been proposed is getting dependencies from the composer.json file. I don't like this for several reasons:
require
list does NOT indicate whether something is a flarum extension. This means that during load, we would need to open and check the composer.json file of every single package required by an extension to make a list of flarum extensions that extension depends onI would like to propose that we build in our own method for dependency management. In addition to the extend.php file, we require a flarum-dependencies.php (or flarum-dependencies.json) file, which would list:
If any of these are omitted, they would be ignored.
This would give us a LOT more robustness in our extension management system.
The text was updated successfully, but these errors were encountered: