<<

NAME

Koha::Plugins::Loader - Lightweight plugin loader for early initialization

SYNOPSIS

    # Safe to call from C4::Context BEGIN block
    use Koha::Plugins::Loader;
    my @plugins = Koha::Plugins::Loader->get_enabled_plugins();

DESCRIPTION

Minimal-dependency plugin loader that can be safely called during early initialization (e.g., from C4::Context BEGIN block) without causing circular dependencies. This module provides a clean separation between plugin loading and the main Koha::Plugins module.

METHODS

get_enabled_plugins

    my @plugins = Koha::Plugins::Loader->get_enabled_plugins();

Returns a list of enabled plugin objects. Results are cached in memory to avoid repeated database queries and plugin instantiation.

This method: - Checks if the plugin_data table exists - Queries for enabled plugins - Loads and instantiates plugin classes - Caches the results

Returns an array of plugin objects in list context, or an empty list if plugins are not available or none are enabled.

AUTHOR

Koha Development Team

<<