Carsten Klein wrote:
> I wonder if it would be possible to add component interdependencies on a
> per plugin basis to the loader and subsequently also the plugin
> administration page?

Why?

(Playing Noah's game, for a change ;-)




If your plugin needs a non-trivial configuration (like having to choose
between one of two components), you will have to document how to
configure it. Why not add the explanation of the required dependencies
in the same documentation?

IMO, such a dependency system would make for complex code for little
added value. How often do you need dependency information about plugins?
Mostly only a single time, when you install the plugin. That's also when
you usually read the documentation, so if the info is there, it's
probably good enough. Nothing prevents you from adding the dependency
information in the component docstring, too, which is displayed in the
plugin admin panel.

If you really want to check dependencies in your plugin, you could add a
warning for the pages served by the plugin in case a dependency is
disabled, and list the actions to be taken by the administrator to
correct the situation: "Please enable Component2, Component3."

The "required" components in Trac core are only defined so as to protect
the administrator from inadvertently shooting herself in the foot, for
example by deactivating the request dispatcher or database connector in
the plugin admin panel.

-- Remy

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to