1
0
Fork 0
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:
epriestley 2016-07-01 16:22:36 -07:00
commit f1c45a3323

View file

@ -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/');