Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
| Show All 32 Lines | try { | ||||
| ->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')) | ||||
| ->setMessage($message) | ->setMessage($message) | ||||
| ->addRelatedPhabricatorConfig('notification.enabled') | ->addRelatedPhabricatorConfig('notification.enabled') | ||||
| ->addRelatedPhabricatorConfig('notification.server-uri') | ->addRelatedPhabricatorConfig('notification.server-uri') | ||||
| ->addCommand( | ->addCommand( | ||||
| pht( | pht( | ||||
| "(To start the server, run this command.)\n". | "(To start the server, run this command.)\n". | ||||
| "phabricator/ $ sudo ./bin/aphlict start")); | "phabricator/ $ ./bin/aphlict start")); | ||||
| return; | return; | ||||
| } | } | ||||
| $expect_version = PhabricatorNotificationClient::EXPECT_VERSION; | $expect_version = PhabricatorNotificationClient::EXPECT_VERSION; | ||||
| $have_version = idx($status, 'version', 1); | $have_version = idx($status, 'version', 1); | ||||
| if ($have_version != $expect_version) { | if ($have_version != $expect_version) { | ||||
| $message = pht( | $message = pht( | ||||
| 'The notification server is out of date. You are running server '. | 'The notification server is out of date. You are running server '. | ||||
| 'version %d, but Phabricator expects version %d. Restart the server '. | 'version %d, but Phabricator expects version %d. Restart the server '. | ||||
| 'to update it, using the command below:', | 'to update it, using the command below:', | ||||
| $have_version, | $have_version, | ||||
| $expect_version); | $expect_version); | ||||
| $this->newIssue('aphlict.version') | $this->newIssue('aphlict.version') | ||||
| ->setShortName(pht('Notification Server Version')) | ->setShortName(pht('Notification Server Version')) | ||||
| ->setName(pht('Notification Server Out of Date')) | ->setName(pht('Notification Server Out of Date')) | ||||
| ->setMessage($message) | ->setMessage($message) | ||||
| ->addCommand('phabricator/ $ sudo ./bin/aphlict restart'); | ->addCommand('phabricator/ $ ./bin/aphlict restart'); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||