/** * @phutil-external-symbol class PhabricatorEnv **/ protected function newConduitClient() { $key_path = $this->getPath('conf/keystore/client.key'); $pub_path = $this->getPath('conf/keystore/client.pub'); $private_key = Filesystem::readFile($key_path); $private_key = new PhutilOpaqueEnvelope($private_key); $public_key = Filesystem::readFile($pub_path); if ($this->getHostAttribute('role') == 'local') { // Modify the configured base URI so that we respect the port and // protocol if they're set up in an unusual way. $admin_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); $admin_uri = new PhutilURI($base_uri); $admin_uri = (string)$base_uri; } else { $admin_uri = 'https://admin.phacility.com/'; } return id(new ConduitClient($admin_uri)) ->setSigningKeys($public_key, $private_key); }