From 923096efc80f46564edd545c5a63508af95a7c2a Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Wed, 14 Jan 2015 13:46:31 -0800 Subject: [PATCH] Config - add phd.variant-config to suppress "Daemon & Web config" error message on a per key basis Summary: Fixes T6959. Test Plan: When I was ready to test the feature, the "Daemon & Web config" error already showed up, from having added phd.variant-config. I went meta and changed the value of phd.variant-config to have phd.variant-config. The config error disappeared. I then changed the conpherence setting about conpherence email prefix and the error showed up again. Removing the conpherence config setting made the error disappear once more. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6959 Differential Revision: https://secure.phabricator.com/D11399 --- .../config/option/PhabricatorPHDConfigOptions.php | 7 +++++++ src/infrastructure/env/PhabricatorEnv.php | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/applications/config/option/PhabricatorPHDConfigOptions.php b/src/applications/config/option/PhabricatorPHDConfigOptions.php index e106e78de2..81a93dfaa7 100644 --- a/src/applications/config/option/PhabricatorPHDConfigOptions.php +++ b/src/applications/config/option/PhabricatorPHDConfigOptions.php @@ -63,6 +63,13 @@ final class PhabricatorPHDConfigOptions "ENORMOUS amount of output, but can help debug issues. Daemons ". "launched in debug mode with 'phd debug' are always launched in ". "trace mdoe. See also 'phd.verbose'.")), + $this->newOption('phd.variant-config', 'list', array()) + ->setDescription( + pht( + 'Specify config keys that can safely vary between the web tier '. + 'and the daemons. Primarily, this is a way to suppress the '. + '"Daemons and Web Have Different Config" setup issue on a per '. + 'config key basis.')), ); } diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php index 5545224ebe..ae40ba4a5c 100644 --- a/src/infrastructure/env/PhabricatorEnv.php +++ b/src/infrastructure/env/PhabricatorEnv.php @@ -232,7 +232,10 @@ final class PhabricatorEnv { public static function calculateEnvironmentHash() { $keys = array_keys(self::getAllConfigKeys()); - ksort($keys); + sort($keys); + + $skip_keys = self::getEnvConfig('phd.variant-config'); + $keys = array_diff($keys, $skip_keys); $values = array(); foreach ($keys as $key) {