Skip to content

Commit

Permalink
Merge pull request #635 from Gizra/634-rollbar
Browse files Browse the repository at this point in the history
Added rollbar configuration
  • Loading branch information
balagan73 authored Mar 14, 2024
2 parents 8381aac + ec68888 commit c1199a7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions web/sites/default/settings.pantheon.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
if (file_exists($local_settings)) {
include $local_settings;
}

$pantheon_env = getenv('PANTHEON_ENVIRONMENT');
$pantheon_site_name = getenv('PANTHEON_SITE_NAME');
$base_private_dir = '../config/elasticsearch';
$settings['site_id'] = 'drupal_starter';
if (file_exists($base_private_dir . '/' . $settings['site_id'] . '.es.secrets.json')) {
$es_credentials = json_decode(file_get_contents($base_private_dir . '/' . $settings['site_id'] . '.es.secrets.json'), TRUE);
if (is_array($es_credentials)) {
$fallback = 'dev';
$pantheon_env = getenv('PANTHEON_ENVIRONMENT');
$env = str_replace('-', '_', !empty($pantheon_env) ? $pantheon_env : $fallback);

if (!isset($es_credentials[$env])) {
Expand All @@ -70,9 +70,15 @@
}
}
}

$pantheon_env = getenv('PANTHEON_ENVIRONMENT');
if (!empty($pantheon_env)) {
// Rollbar settings for LIVE and TEST.
if ($pantheon_env == 'live' || $pantheon_env == 'test') {
$config['rollbar.settings']['environment'] = $pantheon_site_name . '.' . $pantheon_env;
$config['rollbar.settings']['enabled'] = TRUE;
// Placeholders for adding the actual access token values.
// $config['rollbar.settings']['access_token'] = '';
// $config['rollbar.settings']['access_token_frontend'] = '';.
}
switch ($pantheon_env) {
case 'test':
$config['environment_indicator.indicator']['bg_color'] = '#ffcc6b';
Expand Down

0 comments on commit c1199a7

Please sign in to comment.