Lines 133-154
sub get_enabled_plugins {
Link Here
|
133 |
my %seen = map { $_ => 1 } @plugin_classes; |
133 |
my %seen = map { $_ => 1 } @plugin_classes; |
134 |
my @plugin_classes = grep { $seen{$_} } @plugin_classes_with_method; |
134 |
my @plugin_classes = grep { $seen{$_} } @plugin_classes_with_method; |
135 |
} |
135 |
} |
136 |
|
|
|
137 |
foreach my $plugin_class (@plugin_classes) { |
138 |
unless (can_load(modules => { $plugin_class => undef }, nocache => 1)) { |
139 |
warn "Failed to load $plugin_class: $Module::Load::Conditional::ERROR"; |
140 |
next; |
141 |
} |
142 |
|
143 |
my $plugin = eval { $plugin_class->new() }; |
144 |
if ($@ || !$plugin) { |
145 |
warn "Failed to instantiate plugin $plugin_class: $@"; |
146 |
next; |
147 |
} |
148 |
|
149 |
push @$enabled_plugins, $plugin; |
150 |
} |
151 |
Koha::Cache::Memory::Lite->set_in_cache(ENABLED_PLUGINS_CACHE_KEY, $enabled_plugins); |
152 |
} |
136 |
} |
153 |
|
137 |
|
154 |
return @$enabled_plugins; |
138 |
return @$enabled_plugins; |
155 |
- |
|
|