当前位置: 首页>>代码示例>>PHP>>正文


PHP xmlrpc_client::setCaCertificate方法代码示例

本文整理汇总了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;
 }
开发者ID:pokmot,项目名称:PHP-iSDK,代码行数:52,代码来源:isdk.php


注:本文中的xmlrpc_client::setCaCertificate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。