|
Lines 33-38
use C4::Output;
Link Here
|
| 33 |
use Koha::Exceptions::Plugin; |
33 |
use Koha::Exceptions::Plugin; |
| 34 |
use Koha::Plugins::Methods; |
34 |
use Koha::Plugins::Methods; |
| 35 |
|
35 |
|
|
|
36 |
use Module::Refresh; |
| 37 |
|
| 36 |
BEGIN { |
38 |
BEGIN { |
| 37 |
my $pluginsdir = C4::Context->config("pluginsdir"); |
39 |
my $pluginsdir = C4::Context->config("pluginsdir"); |
| 38 |
my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir; |
40 |
my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir; |
|
Lines 187-197
sub InstallPlugins {
Link Here
|
| 187 |
|
189 |
|
| 188 |
my @plugin_classes = $self->plugins(); |
190 |
my @plugin_classes = $self->plugins(); |
| 189 |
my @plugins; |
191 |
my @plugins; |
|
|
192 |
my $refresher = Module::Refresh->new; |
| 190 |
|
193 |
|
| 191 |
foreach my $plugin_class (@plugin_classes) { |
194 |
foreach my $plugin_class (@plugin_classes) { |
| 192 |
if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) { |
195 |
if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) { |
| 193 |
next unless $plugin_class->isa('Koha::Plugins::Base'); |
196 |
next unless $plugin_class->isa('Koha::Plugins::Base'); |
| 194 |
|
197 |
|
|
|
198 |
# If using Plack or memcached and reinstalling a Plugin that existed previously, the module needs to be refreshed. |
| 199 |
my $module_name = ($plugin_class =~ s|::|/|gr) . '.pm'; |
| 200 |
|
| 201 |
try { |
| 202 |
$refresher->refresh_module($module_name); |
| 203 |
} |
| 204 |
catch { |
| 205 |
warn "$_"; |
| 206 |
} |
| 207 |
|
| 195 |
my $plugin; |
208 |
my $plugin; |
| 196 |
my $failed_instantiation; |
209 |
my $failed_instantiation; |
| 197 |
|
210 |
|
| 198 |
- |
|
|