'help' => 'List of event listener classes to install at startup.',
'example' => '["ExampleEventListener"]',
),
+ 'http.basicauth.user' => array(
+ 'type' => 'string',
+ 'help' =>
+ "Username to use for basic auth over http transports",
+ 'example' => '"bob"',
+ ),
+ 'http.basicauth.pass' => array(
+ 'type' => 'string',
+ 'help' =>
+ "Password to use for basic auth over http transports",
+ 'example' => '"bobhasasecret"',
+ ),
);
}
$this->conduit->setTimeout($this->conduitTimeout);
}
+ $user = $this->getConfigFromWhateverSourceAvailiable('http.basicauth.user');
+ $pass = $this->getConfigFromWhateverSourceAvailiable('http.basicauth.pass');
+ if ($user !== null && $pass !== null) {
+ $this->conduit->setBasicAuthCredentials($user, $pass);
+ }
+
return $this;
}
+ final public function getConfigFromWhateverSourceAvailiable($key) {
+ if ($this->requiresWorkingCopy()) {
+ $working_copy = $this->getWorkingCopy();
+ return $working_copy->getConfigFromAnySource($key);
+ } else {
+ $global_config = self::readGlobalArcConfig();
+ $pval = idx($global_config, $key);
+
+ if ($pval === null) {
+ $system_config = self::readSystemArcConfig();
+ $pval = idx($system_config, $key);
+ }
+
+ return $pval;
+ }
+ }
+
/**
* Set credentials which will be used to authenticate against Conduit. These
$config = self::readUserConfigurationFile();
echo "Trying to connect to server...\n";
- $conduit = new ConduitClient($uri);
+ $conduit = $this->establishConduit()->getConduit();
try {
$conduit->callMethodSynchronous('conduit.ping', array());
} catch (Exception $ex) {