diff --git a/inc/namespace.php b/inc/namespace.php index f8c3f4a..6123c60 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -4,6 +4,7 @@ use const Altis\ROOT_DIR; use function Altis\get_config; +use function Altis\get_environment_architecture; /** * Bootstrap. @@ -19,6 +20,12 @@ function on_plugins_loaded() { $config = get_config()['modules']['dev-tools']; if ( $config['query-monitor'] ) { + // In Cloud environments, disable the Query Monitor error handler + // as this will override our own error handler in Cloud. + if ( in_array( get_environment_architecture(), [ 'ec2', 'ecs' ], true ) ) { + define( 'QM_DISABLE_ERROR_HANDLER', true ); + } + // Hide the db.php dropin installation warning and prompt. add_filter( 'qm/show_extended_query_prompt', '__return_false' ); require_once ROOT_DIR . '/vendor/johnbillion/query-monitor/query-monitor.php';