Portal plugins should not require an "init" method
Currently, writing a new plugin (as a dev or as a LLNG admin) requires writing a
sub init {
...
return 1;
}
method.
In lots of cases, the method does nothing except return 1
, but forgetting it will crash the portal.
Using Moose attribute builders (especially with lazy => 1
) also make the init
method even less useful.
I think we should remove this requirement:
-
Either by providing a trivial
init
method inLemonldap::NG::Portal::Main::Plugin
that people who write complex plugins can override -
Or by changing loadModule to avoid calling
init
if it does not exist:
if ($obj->can('init') and $obj->init() == 0) {
$self->error("$module init failed");
return 0;
}
Any objections / preferrences @guimard ?