Skip to main content

Add-on refactoring

!Friendica Developers

So this are my first thoughs about the Addons:

  • Metadata about each add-on should be in an extra file, I would prefer something like addon.json
  • I would like to replace the whole Hook class with a proper Registration class, which is loaded when activating the Add-on. So we can remove the whole Hook table.
  • All Events in Friendica should be in an events.config.php with a proper description (maybe as constants?)
  • for legacy purpose, I would create a wrapper class like the LegacyModule class, which would execute the corresponding php-functions
  • I'm thinking about a giving each Event a specific interface (not knowing how tbh currently, maybe the corresponding interface setting as a value for the Event inside the events.config.php?), so each event and each add-on will know exactly what parameters and which result is necessary

This is it so far..

I would like to start with creating the events.config.php and replace all text with constants.. I think this is a non invasive behaviour, but gives some insights about the next steps

Friendica Developers reshared this.

Like always this is kind of foggy for me :-) But I guess it will be a good idea to implement it in parallel to the current mechanism and then to move the addons step by step.

Du you have got an idea how to keep the folder structure in a way that all addons will stay in the addon folder?

Friendica Developers reshared this.

The folder structure won’t change, but instead of a list of functions, addons will become classes.

Friendica Developers reshared this.