use Koha::Exceptions::Plugin;
use Koha::Plugins::Methods;
+use constant ENABLED_PLUGINS_CACHE_KEY => 'enabled_plugins';
+
BEGIN {
my $pluginsdir = C4::Context->config("pluginsdir");
my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
return unless C4::Context->config('enable_plugins');
- my $cache_key = 'enabled_plugins';
- my $enabled_plugins = Koha::Cache::Memory::Lite->get_from_cache($cache_key);
+ my $enabled_plugins = Koha::Cache::Memory::Lite->get_from_cache(ENABLED_PLUGINS_CACHE_KEY);
unless ($enabled_plugins) {
$enabled_plugins = [];
my $rs = Koha::Database->schema->resultset('PluginData');
push @$enabled_plugins, $plugin;
}
- Koha::Cache::Memory::Lite->set_in_cache($cache_key, $enabled_plugins);
+ Koha::Cache::Memory::Lite->set_in_cache(ENABLED_PLUGINS_CACHE_KEY, $enabled_plugins);
}
return @$enabled_plugins;
warn $error unless $error =~ m|^Could not find or check module '$plugin_class'|;
}
}
+
+ Koha::Cache::Memory::Lite->clear_from_cache(ENABLED_PLUGINS_CACHE_KEY);
+
return @plugins;
}
use C4::Output qw( output_with_http_headers );
use Koha::Exceptions::Plugin;
+use Koha::Cache::Memory::Lite;
=head1 NAME
foreach my $key ( keys %$data ) {
$sth->execute( $self->{'class'}, $key, $data->{$key} );
}
+
+ if (exists $data->{__ENABLED__}) {
+ Koha::Cache::Memory::Lite->clear_from_cache(Koha::Plugins->ENABLED_PLUGINS_CACHE_KEY);
+ }
}
=head2 retrieve_data