Le 11/11/2020 à 01:17, dc...@prosentient.com.au a écrit :
Hi all,

I was talking about how we could override default Koha modules with customized versions by just making sure those modules were located earlier in @INC.

That got me thinking… at the moment we put Koha Plugins at the bottom of @INC, but we could actually put them at the start of @INC.

They would be more dangerous as they’d be able to override any Perl module… but they would also be more powerful.

More powerful, and quite impossible to maintain, as every change to the module would have to be done in the plugin as well :/
Also, two plugins overriding the same module... It just won't work.


In the context of a Koha where controllers are Perl modules (e.g. Mojolicious controllers) rather than Perl scripts, a plugin could override any controller in Koha. That could make for very powerful and seamless customizations.

For this particular use case I think there are better options, like giving plugins access to the Mojolicious router, which allows to override some routes. Also note that Mojolicious has its own plugin system that can be used as well. For now the list of plugins used by Mojolicious applications is static, but it certainly can be made dynamic without much effort.

--
Julian Maurice
BibLibre
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to