Moves plugin loading after we have DB connection in index
parent
0b3ff9e40b
commit
c42b2ff483
|
|
@ -84,11 +84,6 @@ function register_plugin_route_prefix(string $prefix, array $definition = []): v
|
|||
PluginRouteRegistry::registerPrefix($prefix, $definition);
|
||||
}
|
||||
|
||||
// Load enabled plugins
|
||||
$plugins_dir = dirname(__DIR__) . '/plugins/';
|
||||
$enabled_plugins = PluginManager::load($plugins_dir);
|
||||
$GLOBALS['enabled_plugins'] = $enabled_plugins;
|
||||
|
||||
// Define CSRF token include path globally
|
||||
if (!defined('CSRF_TOKEN_INCLUDE')) {
|
||||
define('CSRF_TOKEN_INCLUDE', APP_PATH . 'includes/csrf_token.php');
|
||||
|
|
@ -178,6 +173,11 @@ use App\Core\DatabaseConnector;
|
|||
$db = DatabaseConnector::connect($config);
|
||||
App::set('db', $db);
|
||||
|
||||
// Load enabled plugins (we need this after DB connection is established)
|
||||
$plugins_dir = dirname(__DIR__) . '/plugins/';
|
||||
$enabled_plugins = PluginManager::load($plugins_dir);
|
||||
$GLOBALS['enabled_plugins'] = $enabled_plugins;
|
||||
|
||||
// Initialize Log throttler
|
||||
require_once APP_PATH . 'core/LogThrottler.php';
|
||||
use App\Core\LogThrottler;
|
||||
|
|
|
|||
Loading…
Reference in New Issue