From cfed37ef8f1fb351dd307c553291d0698fbec5e5 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Mon, 4 May 2026 10:19:27 +0300 Subject: [PATCH] Imports classes in plugins with "use" instead of full references. --- plugins/logs/bootstrap.php | 27 ++++++++++++++++++++++- plugins/logs/controllers/logs.php | 6 +++-- plugins/logs/views/logs.php | 4 +++- plugins/register/controllers/register.php | 10 +++++---- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/plugins/logs/bootstrap.php b/plugins/logs/bootstrap.php index 3bb1298..5ce2ad3 100644 --- a/plugins/logs/bootstrap.php +++ b/plugins/logs/bootstrap.php @@ -1,5 +1,8 @@ function($action, array $context = []) { @@ -34,7 +55,7 @@ if (!function_exists('logs_ensure_tables')) { if ($ensured) { return; } - $db = \App\App::db(); + $db = App::db(); if (!$db || !method_exists($db, 'getConnection')) { return; } @@ -73,6 +94,10 @@ if (!function_exists('logs_ensure_tables')) { // Logger plugin bootstrap register_hook('logger.system_init', function(array $context) { + if (!logs_plugin_is_enabled()) { + return; + } + // Ensure tables exist logs_ensure_tables(); diff --git a/plugins/logs/controllers/logs.php b/plugins/logs/controllers/logs.php index 589b1e9..ba7130e 100644 --- a/plugins/logs/controllers/logs.php +++ b/plugins/logs/controllers/logs.php @@ -1,5 +1,7 @@
diff --git a/plugins/register/controllers/register.php b/plugins/register/controllers/register.php index f87560e..820bb15 100644 --- a/plugins/register/controllers/register.php +++ b/plugins/register/controllers/register.php @@ -1,5 +1,7 @@