Differential D11143 Diff 26755 src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | final protected function willLaunch() { | ||||
| $pid = $this->getPID(); | $pid = $this->getPID(); | ||||
| if ($pid) { | if ($pid) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'Unable to start notifications server because it is already '. | 'Unable to start notifications server because it is already '. | ||||
| 'running. Use `aphlict restart` to restart it.')); | 'running. Use `aphlict restart` to restart it.')); | ||||
| } | } | ||||
| if (posix_getuid() != 0) { | |||||
| throw new PhutilArgumentUsageException( | |||||
| pht( | |||||
| 'You must run this script as root; the Aphlict server needs to bind '. | |||||
| 'to privileged ports.')); | |||||
| } | |||||
| // This will throw if we can't find an appropriate `node`. | // This will throw if we can't find an appropriate `node`. | ||||
| $this->getNodeBinary(); | $this->getNodeBinary(); | ||||
| } | } | ||||
| final protected function launch($debug = false) { | final protected function launch($debug = false) { | ||||
| $console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
| if ($debug) { | if ($debug) { | ||||
| $console->writeOut(pht("Starting Aphlict server in foreground...\n")); | $console->writeOut(pht("Starting Aphlict server in foreground...\n")); | ||||
epriestley: Oh, unused -- I'll remove. | |||||
| } else { | } else { | ||||
| Filesystem::writeFile($this->getPIDPath(), getmypid()); | Filesystem::writeFile($this->getPIDPath(), getmypid()); | ||||
| } | } | ||||
| $server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri'); | $server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri'); | ||||
| $server_uri = new PhutilURI($server_uri); | $server_uri = new PhutilURI($server_uri); | ||||
| $client_uri = PhabricatorEnv::getEnvConfig('notification.client-uri'); | $client_uri = PhabricatorEnv::getEnvConfig('notification.client-uri'); | ||||
| ▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines | |||||
Oh, unused -- I'll remove.