Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
<?php | <?php | ||||
final class PhabricatorAphlictSetupCheck extends PhabricatorSetupCheck { | final class PhabricatorAphlictSetupCheck extends PhabricatorSetupCheck { | ||||
protected function executeChecks() { | protected function executeChecks() { | ||||
try { | try { | ||||
PhabricatorNotificationClient::tryAnyConnection(); | PhabricatorNotificationClient::tryAnyConnection(); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
$message = pht( | $message = pht( | ||||
"Phabricator is configured to use a notification server, but is ". | "This server is configured to use a notification server, but is ". | ||||
"unable to connect to it. You should resolve this issue or disable ". | "unable to connect to it. You should resolve this issue or disable ". | ||||
"the notification server. It may be helpful to double check your ". | "the notification server. It may be helpful to double check your ". | ||||
"configuration or restart the server using the command below.\n\n%s", | "configuration or restart the server using the command below.\n\n%s", | ||||
phutil_tag( | phutil_tag( | ||||
'pre', | 'pre', | ||||
array(), | array(), | ||||
array( | array( | ||||
get_class($ex), | get_class($ex), | ||||
"\n", | "\n", | ||||
$ex->getMessage(), | $ex->getMessage(), | ||||
))); | ))); | ||||
$this->newIssue('aphlict.connect') | $this->newIssue('aphlict.connect') | ||||
->setShortName(pht('Notification Server Down')) | ->setShortName(pht('Notification Server Down')) | ||||
->setName(pht('Unable to Connect to Notification Server')) | ->setName(pht('Unable to Connect to Notification Server')) | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
'Phabricator is configured to use a notification server, '. | 'This server is configured to use a notification server, '. | ||||
'but is not able to connect to it.')) | 'but is not able to connect to it.')) | ||||
->setMessage($message) | ->setMessage($message) | ||||
->addRelatedPhabricatorConfig('notification.servers') | ->addRelatedPhabricatorConfig('notification.servers') | ||||
->addCommand( | ->addCommand( | ||||
pht( | pht( | ||||
"(To start the server, run this command.)\n%s", | "(To start the server, run this command.)\n%s", | ||||
'phabricator/ $ ./bin/aphlict start')); | '$ ./bin/aphlict start')); | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
} | } |