Dealing with interdependent plugins

In a big project with lots of new APIs several plugins have grown to have entangled dependencies. Effectively these plugins can't be enabled/disabled!

I'm thinking I'm going to have to add a way for some plugins to be "always on" or alter all their inits so they do nothing unless they're all enabled. That won't stop views from being overridden though.

Any ideas?

  • Simplest version would be to check others on system init in some plugin that we assume will always be on and won't ever crash. That's not secure enough IMHO.

    I'd like to move from storing all configuration in database towards encouraging to keep it in filesystem by default. That's relevant mostly for main configuration stuff (site name, dataroot, wwwroot main url).

    I imagine that realistic solution might be to add option (to the core obviously) to specify enabled plugins and their order in settings.php. When present, it would disable any option to enable/disable/reorder plugins through admin panel. Such solution would be best for production environments to improve stability.

    Going slightly further, for a long time I was longing for a more configurable way of bootstrapping Elgg core. We have now one point of entry (index.php), which makes it viable option to replace inclusion of engine/start.php with instantiation of something like ElggApplication class that would take some configuration options (ie. path to settings.php or settings directly) in constructor parameters, and allow more control on bootstrapping level (by customizing index.php or writing very own integration).

  • I think that is a good idea. It could be facilitated in the manifest.xml file.

    On the other end of this spectrum there is another way to further stabilize the init process.

    In manifest, you could define dependencies when a plugin's start file should be started. Like when it has a dependency on a container or context and it has only some use over there. (so always off, unless....)

    Now all start.php files are processed for every request and that is inefficient and also destabilizing Elgg.

    I am currently doing this in the beginning of the start.php  for a lot of plugins and break the start routine if some conditions are not met. That has served me well in improving performance and avoid dependencies. It avoids a plugin has to process all the functions and load javascript and css. But I would prefer this as a setting in manifest.

    Do you agree ?