[Koha-bugs] [Bug 21073] Improve plugin performance

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 20 12:36:51 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21073

Andrew Isherwood <andrew.isherwood at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew.isherwood at ptfs-europ
                   |                            |e.com

--- Comment #96 from Andrew Isherwood <andrew.isherwood at ptfs-europe.com> ---
I pulled latest master today and received this bug, looks great, nice job!

I spotted something though and am not sure if it's expected behaviour or a bug. 

The database update that adds the plugin_methods table and then calls
Koha::Plugins::InstallPlugins to populate it. However, upon looking at the
plugin_methods table, I'm seeing far more methods than are exposed by my single
installed plugin (CLA Permissions Check).

Here are the methods that the plugin contains:

koha-koha at aidev:/var/lib/koha/koha/plugins/Koha/Plugin/Com/PTFSEurope$ cat
CLAPermissionsCheck.pm  | grep '^sub '
sub new {
sub intranet_catalog_biblio_enhancements {
sub intranet_catalog_biblio_enhancements_toolbar_button {
sub get_link {
sub clean_isbn {
sub clean_issn {
sub check_start {
sub configure {
sub install() {
sub upgrade {
sub uninstall() {

...and this is the contents of my plugin_methods table:

MariaDB [koha_demo1]> select * from plugin_methods;
+----------------------------------------------------+-----------------------------------------------------+
| plugin_class                                       | plugin_method           
                           |
+----------------------------------------------------+-----------------------------------------------------+
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | abs_path                
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | as_heavy                
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | bundle_path             
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | canonpath               
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | catdir                  
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | catfile                 
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | check_start             
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | clean_isbn              
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | clean_issn              
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | configure               
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | curdir                  
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | decode_json             
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | disable                 
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | dt_from_string          
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | enable                  
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | except                  
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | export                  
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | export_fail             
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | export_ok_tags          
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | export_tags             
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | export_to_level         
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | file_name_is_absolute   
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | get_link                
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | get_metadata            
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | get_plugin_http_path    
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | get_qualified_table_name
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | get_template            
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | go_home                 
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | import                  
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | install                 
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck |
intranet_catalog_biblio_enhancements                |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck |
intranet_catalog_biblio_enhancements_toolbar_button |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | is_enabled              
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | max                     
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | mbf_dir                 
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | mbf_exists              
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | mbf_open                
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | mbf_path                
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | mbf_read                
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | mbf_validate            
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | new                     
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | no_upwards              
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | only                    
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | output                  
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | output_html             
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck |
output_html_with_http_headers                       |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | output_with_http_headers
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | path                    
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | plugins                 
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | require_version         
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | retrieve_data           
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | rootdir                 
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | search_path             
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | sha256_hex              
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | store_data              
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | uninstall               
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | updir                   
                           |
| Koha::Plugin::Com::PTFSEurope::CLAPermissionsCheck | upgrade                 
                           |
+----------------------------------------------------+-----------------------------------------------------+

It seems to be grabbing all public methods, even those imported from other
modules (explicitly or otherwise). Which, though they could be strictly argued
to be capabilities of the plugin, aren't native to it and could easily lead to
confusion.

I couldn't see any discussion in this bug pertaining to this, so apologies if
it's already been mentioned.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list