Bug 21073: Improve plugin performance
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jul 2018 16:40:52 +0000 (12:40 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 18 Jun 2019 16:29:23 +0000 (17:29 +0100)
commit9d81b1dd7ad1bb2957630e1ec40d636d8839bb16
tree08dd8ce9a6a042406c248e9329b9bde82216c596
parent1ed59cbe5565ca493702691d3a8811f4ebc4da17
Bug 21073: Improve plugin performance

Right now, to check if a plugin is functional and what methods it exposes we load the module and test for a given method at run time. This is highly inefficient. It makes far more sense to do this at install time and store the data in the db. I believe we should store a table of methods that each plugin exposes and check that instead. Then, at install time we can test that a) the plugin can be loaded and b) add the available methods to the plugin_methods table.

Test Plan:
1) Apply this patch
2) Restart all the things
3) Run updatedatabase.pl
4) Verify you can use existing plugins
5) Verify you can install new plugins

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Plugins.pm
Koha/Plugins/Handler.pm
Koha/Plugins/Methods.pm
koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt
plugins/plugins-upload.pl
t/db_dependent/Plugins.t