Bug 16105: Do not initialize the memory cache if not needed
[srvgit] / Koha / Plugins.pm
index 3b31fc5..bca7701 100644 (file)
@@ -4,23 +4,23 @@ package Koha::Plugins;
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
 
 use Module::Load::Conditional qw(can_load);
-use Module::Pluggable search_path => ['Koha::Plugin'];
+use Module::Pluggable search_path => ['Koha::Plugin'], except => qr/::Edifact(|::Line|::Message|::Order|::Segment|::Transport)$/;
 
 use C4::Context;
 use C4::Output;
@@ -51,7 +51,7 @@ This will return a list of all the available plugins of the passed type.
 
 Usage: my @plugins = C4::Plugins::GetPlugins( $method );
 
-At the moment, the available types are 'report' and 'tool'.
+At the moment, the available types are 'report', 'tool' and 'to_marc'.
 =cut
 
 sub GetPlugins {
@@ -63,6 +63,8 @@ sub GetPlugins {
 
     foreach my $plugin_class (@plugin_classes) {
         if ( can_load( modules => { $plugin_class => undef } ) ) {
+            next unless $plugin_class->isa('Koha::Plugins::Base');
+
             my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} });
 
             if ($method) {