From 314d79d260ae8d93a334e81136a48d2bcf3c2557 Mon Sep 17 00:00:00 2001 From: "Ernesto Serrano (aider)" Date: Sat, 19 Oct 2024 19:04:13 +0100 Subject: [PATCH] feat: Add --debug option to enable detailed error messages in plugin manager --- rootfs/var/www/html/admin/cli/install_plugin.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rootfs/var/www/html/admin/cli/install_plugin.php b/rootfs/var/www/html/admin/cli/install_plugin.php index 3a756ab..9955fda 100644 --- a/rootfs/var/www/html/admin/cli/install_plugin.php +++ b/rootfs/var/www/html/admin/cli/install_plugin.php @@ -15,6 +15,7 @@ --type= The type of the plugin (e.g., mod, block, filter, theme, local). Defaults to mod. --run Execute install. If this option is not set, the script will run in dry mode. --force Force install even if plugin exists (useful for development). + --debug Enable debug mode to see detailed error messages. --showsql Show SQL queries before they are executed. --showdebugging Show developer level debugging information. @@ -37,6 +38,7 @@ 'run' => false, 'force' => false, 'showsql' => false, + 'debug' => false, 'showdebugging' => false, ], [ 'h' => 'help' @@ -47,6 +49,11 @@ cli_error(get_string('cliunknowoption', 'core_admin', $unrecognised)); } +if ($options['debug']) { + set_debugging(DEBUG_DEVELOPER, true); + cli_writeln('Debug mode enabled.'); +} + if ($options['help']) { cli_writeln($help); exit(0);