From 7d213f479a7e40c6254069b5fc4e578dc32bf8d9 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 23 May 2025 08:50:38 +0200 Subject: [PATCH] feat: autoload install.php --- system/src/Plugins.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/system/src/Plugins.php b/system/src/Plugins.php index 2e55cce8..8e284484 100644 --- a/system/src/Plugins.php +++ b/system/src/Plugins.php @@ -677,10 +677,15 @@ class Plugins { return false; } - if (isset($plugin_json['install'])) { - if (file_exists(BASE . $plugin_json['install'])) { + $install = $plugin_json['install'] ?? ''; + if (self::getAutoLoadOption($plugin_json, 'install', true) && is_file(PLUGINS . $pluginFilename . '/install.php')) { + $install = 'plugins/' . $pluginFilename . '/install.php'; + } + + if (!empty($install)) { + if (file_exists(BASE . $install)) { $db->revalidateCache(); - require BASE . $plugin_json['install']; + require BASE . $install; $db->revalidateCache(); } else