本文整理汇总了PHP中xmlrpc_client::setCaCertificate方法的典型用法代码示例。如果您正苦于以下问题:PHP xmlrpc_client::setCaCertificate方法的具体用法?PHP xmlrpc_client::setCaCertificate怎么用?PHP xmlrpc_client::setCaCertificate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpc_client
的用法示例。
在下文中一共展示了xmlrpc_client::setCaCertificate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vendorCon
/**
* @method getTemporaryKey
* @description Connect and Obtain an API key from a vendor key
* @param string $name - Application Name
* @param string $user - Username
* @param string $pass - Password
* @param string $key - Vendor Key
* @param string $dbOn - Error Handling On
* @return bool
* @throws iSDKException
*/
public function vendorCon($name, $user, $pass, $key = "", $dbOn = "on")
{
$this->debug = $key == 'on' || $key == 'off' || $key == 'kill' || $key == 'throw' ? $key : $dbOn;
if ($key != "" && $key != "on" && $key != "off" && $key != 'kill' && $key != 'throw') {
$this->client = new xmlrpc_client("https://{$name}.infusionsoft.com/api/xmlrpc");
$this->key = $key;
} else {
/** @var array $connInfo */
include 'conn.cfg.php';
$appLines = $connInfo;
foreach ($appLines as $appLine) {
$details[substr($appLine, 0, strpos($appLine, ":"))] = explode(":", $appLine);
}
if (!empty($details[$name])) {
if ($details[$name][2] == "i") {
$this->client = new xmlrpc_client("https://" . $details[$name][1] . ".infusionsoft.com/api/xmlrpc");
} elseif ($details[$name][2] == "m") {
$this->client = new xmlrpc_client("https://" . $details[$name][1] . ".mortgageprocrm.com/api/xmlrpc");
} else {
throw new iSDKException("Invalid application name: \"" . $name . "\"");
}
} else {
throw new iSDKException("Application Does Not Exist: \"" . $name . "\"");
}
$this->key = $details[$name][3];
}
/* Return Raw PHP Types */
$this->client->return_type = "phpvals";
/* SSL Certificate Verification */
$this->client->setSSLVerifyPeer(true);
$this->client->setCaCertificate((__DIR__ != '__DIR__' ? __DIR__ : dirname(__FILE__)) . '/infusionsoft.pem');
$encoded_parameters = array(php_xmlrpc_encode($this->key), php_xmlrpc_encode($user), php_xmlrpc_encode(md5($pass)));
$this->key = $this->methodCaller("DataService.getTemporaryKey", $encoded_parameters);
$this->encKey = php_xmlrpc_encode($this->key);
try {
$connected = $this->dsGetSetting("Application", "enabled");
} catch (iSDKException $e) {
throw new iSDKException("Connection Failed");
}
return true;
}