mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-12-29 17:00:58 +01:00
(stable) Promote 2016 Week 27
This commit is contained in:
commit
f1c45a3323
1 changed files with 19 additions and 2 deletions
|
@ -196,14 +196,31 @@ EOTEXT
|
|||
$uri = $conduit_uri;
|
||||
}
|
||||
|
||||
$example = 'https://phabricator.example.com/';
|
||||
|
||||
$uri_object = new PhutilURI($uri);
|
||||
if (!$uri_object->getProtocol() || !$uri_object->getDomain()) {
|
||||
$protocol = $uri_object->getProtocol();
|
||||
if (!$protocol || !$uri_object->getDomain()) {
|
||||
throw new ArcanistUsageException(
|
||||
pht(
|
||||
'Server URI "%s" must include a protocol and domain. It should be '.
|
||||
'in the form "%s".',
|
||||
$uri,
|
||||
'https://phabricator.example.com/'));
|
||||
$example));
|
||||
}
|
||||
|
||||
$protocol = $uri_object->getProtocol();
|
||||
switch ($protocol) {
|
||||
case 'http':
|
||||
case 'https':
|
||||
break;
|
||||
default:
|
||||
throw new ArcanistUsageException(
|
||||
pht(
|
||||
'Server URI "%s" must include the "http" or "https" protocol. '.
|
||||
'It should be in the form "%s".',
|
||||
$uri,
|
||||
$example));
|
||||
}
|
||||
|
||||
$uri_object->setPath('/api/');
|
||||
|
|
Loading…
Reference in a new issue