Skip to content

Commit

Permalink
Disable the QM error handler in Cloud
Browse files Browse the repository at this point in the history
there can only be one `error_handler` and we don't want QM to swallow all the erorrs in Cloud, as we also have an error handler.
  • Loading branch information
joehoyle committed May 20, 2019
1 parent df7e017 commit 26f70a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use const Altis\ROOT_DIR;
use function Altis\get_config;
use function Altis\get_environment_architecture;

/**
* Bootstrap.
Expand All @@ -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';
Expand Down

0 comments on commit 26f70a7

Please sign in to comment.