Differential D15709 Diff 37858 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 93 Lines • ▼ Show 20 Lines | foreach ($servers as $index => $server) { | ||||
| PhutilTypeSpec::checkMap( | PhutilTypeSpec::checkMap( | ||||
| $server, | $server, | ||||
| array( | array( | ||||
| 'type' => 'string', | 'type' => 'string', | ||||
| 'port' => 'int', | 'port' => 'int', | ||||
| 'listen' => 'optional string|null', | 'listen' => 'optional string|null', | ||||
| 'ssl.key' => 'optional string|null', | 'ssl.key' => 'optional string|null', | ||||
| 'ssl.cert' => 'optional string|null', | 'ssl.cert' => 'optional string|null', | ||||
| 'ssl.chain' => 'optional string|null', | |||||
| )); | )); | ||||
| $port = $server['port']; | $port = $server['port']; | ||||
| if (!isset($port_map[$port])) { | if (!isset($port_map[$port])) { | ||||
| $port_map[$port] = $index; | $port_map[$port] = $index; | ||||
| } else { | } else { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| Show All 30 Lines | foreach ($servers as $index => $server) { | ||||
| 'A specified server (at index "%s", on port "%s") specifies '. | 'A specified server (at index "%s", on port "%s") specifies '. | ||||
| 'only one of "%s" and "%s". Each server must specify neither '. | 'only one of "%s" and "%s". Each server must specify neither '. | ||||
| '(to disable SSL) or specify both (to enable it).', | '(to disable SSL) or specify both (to enable it).', | ||||
| $index, | $index, | ||||
| $port, | $port, | ||||
| 'ssl.key', | 'ssl.key', | ||||
| 'ssl.cert')); | 'ssl.cert')); | ||||
| } | } | ||||
| $ssl_chain = idx($server, 'ssl.chain'); | |||||
| if ($ssl_chain && (!$ssl_key && !$ssl_cert)) { | |||||
| throw new PhutilArgumentUsageException( | |||||
| pht( | |||||
| 'A specified server (at index "%s", on port "%s") specifies '. | |||||
| 'a value for "%s", but no value for "%s" or "%s". Servers '. | |||||
| 'should only provide an SSL chain if they also provide an SSL '. | |||||
| 'key and SSL certificate.', | |||||
| $index, | |||||
| $port, | |||||
| 'ssl.chain', | |||||
| 'ssl.key', | |||||
| 'ssl.cert')); | |||||
| } | |||||
| } | } | ||||
| if (!$servers) { | if (!$servers) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'Configuration file does not specify any servers. This service '. | 'Configuration file does not specify any servers. This service '. | ||||
| 'will not be able to interact with the outside world if it does '. | 'will not be able to interact with the outside world if it does '. | ||||
| 'not listen on any ports. You must specify at least one "%s" '. | 'not listen on any ports. You must specify at least one "%s" '. | ||||
| ▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines | |||||