From 36ec2e1e56b58730dbe436e1a7686d4a1869a0ce Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 25 Nov 2023 10:10:15 +0100 Subject: [PATCH] Add option to execute "install" part of the plugin --- system/bin/execute_install_plugin.php | 31 +++++++++++++++++++++ system/libs/plugins.php | 39 +++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 system/bin/execute_install_plugin.php diff --git a/system/bin/execute_install_plugin.php b/system/bin/execute_install_plugin.php new file mode 100644 index 00000000..b6127a66 --- /dev/null +++ b/system/bin/execute_install_plugin.php @@ -0,0 +1,31 @@ +revalidateCache(); + require BASE . $plugin_json['install']; + $db->revalidateCache(); + } + else { + self::$warnings[] = 'Cannot load install script. Your plugin might be not working correctly.'; + } + + return true; + } + public static function uninstall($plugin_name): bool { $filename = BASE . 'plugins/' . $plugin_name . '.json';