diff --git a/src/applications/config/check/PhabricatorSetupCheckDaemons.php b/src/applications/config/check/PhabricatorSetupCheckDaemons.php index 8ea68debbe..9e02ac4ed9 100644 --- a/src/applications/config/check/PhabricatorSetupCheckDaemons.php +++ b/src/applications/config/check/PhabricatorSetupCheckDaemons.php @@ -62,8 +62,15 @@ final class PhabricatorSetupCheckDaemons extends PhabricatorSetupCheck { 'configuration. If you are making multiple configuration changes, '. 'you only need to restart the daemons once after the last change.'. "\n\n". - 'Use %s to restart daemons. See %s for more information.', + 'Use %s to restart daemons. See the %s or %s for more information.', phutil_tag('tt', array(), 'bin/phd restart'), + phutil_tag( + 'a', + array( + 'href' => '/daemon/', + 'target' => '_blank' + ), + pht('Daemon Console')), phutil_tag( 'a', array( diff --git a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php index ef6315bfc2..10ee28471d 100644 --- a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php +++ b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php @@ -64,6 +64,14 @@ final class PhabricatorDaemonLogViewController } $header->addTag($tag); + $env_hash = PhabricatorEnv::calculateEnvironmentHash(); + if ($log->getEnvHash() != $env_hash) { + $tag = id(new PHUITagView()) + ->setType(PHUITagView::TYPE_STATE) + ->setBackgroundColor(PHUITagView::COLOR_YELLOW) + ->setName(pht('Stale Config')); + $header->addTag($tag); + } $properties = $this->buildPropertyListView($log); diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php index e9f7876d07..a1f668d480 100644 --- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php +++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php @@ -17,6 +17,7 @@ final class PhabricatorDaemonLogListView extends AphrontView { throw new Exception('Call setUser() before rendering!'); } + $env_hash = PhabricatorEnv::calculateEnvironmentHash(); $list = new PHUIObjectItemListView(); foreach ($this->daemonLogs as $log) { $id = $log->getID(); @@ -31,8 +32,15 @@ final class PhabricatorDaemonLogListView extends AphrontView { $status = $log->getStatus(); switch ($status) { case PhabricatorDaemonLog::STATUS_RUNNING: - $item->setBarColor('green'); - $item->addAttribute(pht('This daemon is running.')); + if ($env_hash != $log->getEnvHash()) { + $item->setBarColor('yellow'); + $item->addAttribute(pht( + 'This daemon is running with an out of date configuration and '. + 'should be restarted.')); + } else { + $item->setBarColor('green'); + $item->addAttribute(pht('This daemon is running.')); + } break; case PhabricatorDaemonLog::STATUS_DEAD: $item->setBarColor('red'); diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php index d5e3237b88..a8f4dcec6b 100644 --- a/src/infrastructure/env/PhabricatorEnv.php +++ b/src/infrastructure/env/PhabricatorEnv.php @@ -223,6 +223,8 @@ final class PhabricatorEnv { public static function calculateEnvironmentHash() { $keys = array_keys(self::getAllConfigKeys()); + asort($keys); + $values = array(); foreach ($keys as $key) { $values[$key] = self::getEnvConfigIfExists($key);