From 3b2c9202a736e29eef88aec5bb079c39a6d7aa27 Mon Sep 17 00:00:00 2001 From: Mark Metcalfe Date: Wed, 26 Nov 2025 14:07:22 +1300 Subject: [PATCH] fix: Prevent Xdebug from triggering when running composer --- php/includes/config-after.php | 3 ++- shell/util-aliases.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/php/includes/config-after.php b/php/includes/config-after.php index 5e7d302a..85187925 100644 --- a/php/includes/config-after.php +++ b/php/includes/config-after.php @@ -302,5 +302,6 @@ // Tell Totara where composer is if (!defined('TOTARA_COMPOSER')) { - define('TOTARA_COMPOSER', '/usr/bin/composer'); + // Disable xdebug when running composer so breakpoints don't interfere with composer operations + define('TOTARA_COMPOSER', 'XDEBUG_MODE=off /usr/bin/composer'); } diff --git a/shell/util-aliases.sh b/shell/util-aliases.sh index 9a7727b1..28b6cc76 100644 --- a/shell/util-aliases.sh +++ b/shell/util-aliases.sh @@ -101,3 +101,6 @@ totara_version() { php -n -r "$php_code echo \$version;" fi } + +# Run composer but disable xdebug for the duration of the command +alias composer='XDEBUG_MODE=off composer'