Skip to content

Commit

Permalink
Merge pull request #5 from swappsco/CU-86aygmk17
Browse files Browse the repository at this point in the history
CU-86aygmk17 - wp-config.php modified to have sentry only on pantheon enviroments
  • Loading branch information
cfp96 authored Oct 19, 2023
2 parents b8c7f1e + 15d2173 commit ebfa3ba
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
*/
if (isset($_ENV['PANTHEON_ENVIRONMENT']) && 'lando' !== $_ENV['PANTHEON_ENVIRONMENT']) {
Config::define('DB_HOST', $_ENV['DB_HOST'] . ':' . $_ENV['DB_PORT']);
$secrets_json_text = file_get_contents('/files/private/secrets.json');
$data = json_decode($secrets_json_text, TRUE);
Config::define('WP_SENTRY_PHP_DSN', $data['WP_SENTRY_PHP_DSN'] ? $data['WP_SENTRY_PHP_DSN'] : "");
Config::define('WP_SENTRY_ENV', $_ENV['PANTHEON_ENVIRONMENT'] == "live" ? "production" : 'develop');
Config::define('WP_SENTRY_ERROR_TYPES', E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_DEPRECATED & ~E_WARNING & ~E_USER_WARNING);
} else {
/**
* URLs
Expand Down Expand Up @@ -138,14 +143,6 @@
require_once $env_config;
}

if (isset($_ENV['PANTHEON_ENVIRONMENT'])) {
$secrets_json_text = file_get_contents('/files/private/secrets.json');
$data = json_decode($secrets_json_text, TRUE);
Config::define('WP_SENTRY_PHP_DSN', $data['WP_SENTRY_PHP_DSN'] ? $data['WP_SENTRY_PHP_DSN'] : "");
Config::define('WP_SENTRY_ENV', $_ENV['PANTHEON_ENVIRONMENT'] == "live" ? "production" : 'develop');
Config::define('WP_SENTRY_ERROR_TYPES', E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_DEPRECATED & ~E_WARNING & ~E_USER_WARNING);
}

Config::apply();

/**
Expand Down

0 comments on commit ebfa3ba

Please sign in to comment.