本文整理汇总了PHP中xmlrpc_client::setSSLVerifyPeer方法的典型用法代码示例。如果您正苦于以下问题:PHP xmlrpc_client::setSSLVerifyPeer方法的具体用法?PHP xmlrpc_client::setSSLVerifyPeer怎么用?PHP xmlrpc_client::setSSLVerifyPeer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpc_client
的用法示例。
在下文中一共展示了xmlrpc_client::setSSLVerifyPeer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getClientConnect
public function getClientConnect()
{
$client = new xmlrpc_client(self::$odoo_url . ":" . self::$odoo_port . "/xmlrpc/object");
$client->setSSLVerifyPeer(0);
$client->setSSLVerifyHost(0);
return $client;
}
示例2: _serv
function _serv()
{
global $wbhost;
$server = new xmlrpc_client($wbhost);
$server->setSSLVerifyPeer(0);
return $server;
}
示例3: forward_request
/**
* Forward an xmlrpc request to another server, and return to client the response received.
* @param xmlrpcmsg $m (see method docs below for a description of the expected parameters)
* @return xmlrpcresp
*/
function forward_request($m)
{
// create client
$timeout = 0;
$url = php_xmlrpc_decode($m->getParam(0));
$c = new xmlrpc_client($url);
if ($m->getNumParams() > 3) {
// we have to set some options onto the client.
// Note that if we do not untaint the received values, warnings might be generated...
$options = php_xmlrpc_decode($m->getParam(3));
foreach ($options as $key => $val) {
switch ($key) {
case 'Cookie':
break;
case 'Credentials':
break;
case 'RequestCompression':
$c->setRequestCompression($val);
break;
case 'SSLVerifyHost':
$c->setSSLVerifyHost($val);
break;
case 'SSLVerifyPeer':
$c->setSSLVerifyPeer($val);
break;
case 'Timeout':
$timeout = (int) $val;
break;
}
// switch
}
}
// build call for remote server
/// @todo find a weay to forward client info (such as IP) to server, either
/// - as xml comments in the payload, or
/// - using std http header conventions, such as X-forwarded-for...
$method = php_xmlrpc_decode($m->getParam(1));
$pars = $m->getParam(2);
$m = new xmlrpcmsg($method);
for ($i = 0; $i < $pars->arraySize(); $i++) {
$m->addParam($pars->arraymem($i));
}
// add debug info into response we give back to caller
xmlrpc_debugmsg("Sending to server {$url} the payload: " . $m->serialize());
return $c->send($m, $timeout);
}
示例4: wordpress_get_options
function wordpress_get_options($xmlrpcurl, $username, $password, $blogid = 0, $proxyipports = "")
{
global $globalerr;
$client = new xmlrpc_client($xmlrpcurl);
$client->setSSLVerifyPeer(false);
$params[] = new xmlrpcval($blogid);
$params[] = new xmlrpcval($username);
$params[] = new xmlrpcval($password);
$msg = new xmlrpcmsg("wp.getOptions", $params);
if (is_array($proxyipports)) {
$proxyipport = $proxyipports[array_rand($proxyipports)];
} elseif ($proxyipports != "") {
$proxyipport = $proxyipports;
} else {
$proxyipport = "";
}
if ($proxyipport != "") {
if (preg_match("/@/", $proxyipport)) {
$proxyparts = explode("@", $proxyipport);
$proxyauth = explode(":", $proxyparts[0]);
$proxyuser = $proxyauth[0];
$proxypass = $proxyauth[1];
$proxy = explode(":", $proxyparts[1]);
$proxyip = $proxy[0];
$proxyport = $proxy[1];
$client->setProxy($proxyip, $proxyport, $proxyuser, $proxypass);
} else {
$proxy = explode(":", $proxyipport);
$proxyip = $proxy[0];
$proxyport = $proxy[1];
$client->setProxy($proxyip, $proxyport);
}
}
$r = $client->send($msg);
if ($r === false) {
$globalerr = "XMLRPC ERROR - Could not send xmlrpc message";
return false;
}
if (!$r->faultCode()) {
return php_xmlrpc_decode($r->value());
} else {
$globalerr = "XMLRPC ERROR - Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'";
}
return false;
}
示例5: 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;
}
示例6: do_call
//
// Include XML-RPC Library
include_once ".xmlrpc.inc.php";
// Define Server environment
// Server
// Production Server
// $client = new xmlrpc_client("/tr_xmlrpc.cgi", "apibugzilla.novell.com", 443, "https");
// Testserver
$client = new xmlrpc_client("/tr_xmlrpc.cgi", "apibugzillastage.provo.novell.com", 443, "https");
// Username and Password (Must be defined in calling script)
// $username = "";
// $password = "";
$client->setCredentials($username, $password);
// SSL Verify Peer
// $client->setSSLVerifyPeer(FALSE);
$client->setSSLVerifyPeer(TRUE);
// Debug on/off
$client->setDebug(0);
// Functions
function do_call($call)
{
global $client;
// Do call and handle feedback
if (!($res = $client->send($call))) {
print "Could not connect to HTTPS server.";
return FALSE;
}
if ($res->faultCode() == 0) {
$value = $res->value();
return php_xmlrpc_decode($value);
} else {
示例7: seed_cspv4_emaillist_infusionsoft_add_subscriber
function seed_cspv4_emaillist_infusionsoft_add_subscriber($args)
{
global $seed_cspv4, $seed_cspv4_post_result;
extract($seed_cspv4);
require_once SEED_CSPV4_PLUGIN_PATH . 'lib/nameparse.php';
if (!class_exists('xmlrpc_client')) {
require_once SEED_CSPV4_PLUGIN_PATH . 'extentions/infusionsoft/xmlrpc-2.0/lib/xmlrpc.inc';
}
// If tracking enabled
if (!empty($enable_reflink)) {
seed_cspv4_emaillist_database_add_subscriber();
}
$app = $infusionsoft_app;
$api_key = $infusionsoft_api_key;
$tag_id = $infusionsoft_tag_id;
$name = '';
if (!empty($_REQUEST['name'])) {
$name = $_REQUEST['name'];
}
$email = $_REQUEST['email'];
$fname = '';
$lname = '';
if (!empty($name)) {
$name = seed_cspv4_parse_name($name);
$fname = $name['first'];
$lname = $name['last'];
}
###Set our Infusionsoft application as the client###
$client = new xmlrpc_client("https://" . $app . ".infusionsoft.com/api/xmlrpc");
###Return Raw PHP Types###
$client->return_type = "phpvals";
###Dont bother with certificate verification###
$client->setSSLVerifyPeer(FALSE);
###Our API Key###
$key = $api_key;
###Build a Key-Value Array to store a contact###
$contact = array("FirstName" => $fname, "LastName" => $lname, "Email" => $email);
$optin_reason = 'Coming Soon Page';
###Set up the call###
$call = new xmlrpcmsg("ContactService.add", array(php_xmlrpc_encode($key), php_xmlrpc_encode($contact)));
$call2 = new xmlrpcmsg("APIEmailService.optIn", array(php_xmlrpc_encode($key), php_xmlrpc_encode($email), php_xmlrpc_encode($optin_reason)));
###Send the call###
$result = $client->send($call);
$result2 = $client->send($call2);
if (!empty($tag_id)) {
$tags = explode(",", $tag_id);
//var_dump($tags);
foreach ($tags as $t) {
$call3 = new xmlrpcmsg("ContactService.addToGroup", array(php_xmlrpc_encode($key), php_xmlrpc_encode($result->value()), php_xmlrpc_encode($t)));
$result3 = $client->send($call3);
}
//var_dump($result3);
}
###Check the returned value to see if it was successful and set it to a variable/display the results###
if (!$result->faultCode()) {
// if(!empty($enable_reflink)){
// seed_cspv4_emaillist_database_add_subscriber();
// }
if (empty($seed_cspv4_post_result['status'])) {
$seed_cspv4_post_result['status'] = '200';
}
// $conID = $result->value();
// print "Contact added was " . $conID;
// print "<BR>";
} else {
$seed_cspv4_post_result['status'] = '500';
// print $result->faultCode() . "<BR>";
// print $result->faultString() . "<BR>";die();
}
}
示例8: addCon
<?php
##########################################################################################################
### Sample Created by Justin Morris on 7/10/08 ###
### In this Sample we will use the InvoiceService to add an order to a contact record. ###
##########################################################################################################
###Include our XMLRPC Library###
include "xmlrpc-2.0/lib/xmlrpc.inc";
###Set our Infusionsoft application as the client###
$client = new xmlrpc_client("https://mach2.infusionsoft.com/api/xmlrpc");
###Return Raw PHP Types###
$client->return_type = "phpvals";
###Dont bother with certificate verification###
$client->setSSLVerifyPeer(FALSE);
###Our API Key###
$key = "13643d3c8910057ce07623ed01bb22b2";
############################################
### Function to create a new contact ###
############################################
function addCon()
{
global $client, $key;
###Create our contact array###
$contact = array("FirstName" => $_POST['fName'], "LastName" => $_POST['lName'], "Email" => $_POST['eMail'], "StreetAddress1" => $_POST['Street'], "City" => $_POST['City'], "State" => $_POST['State'], "PostalCode" => $_POST['zip']);
###Build the Call###
$call = new xmlrpcmsg("ContactService.add", array(php_xmlrpc_encode($key), php_xmlrpc_encode($contact)));
###Send the call###
$result = $client->send($call);
if (!$result->faultCode()) {
return $result->value();
} else {
示例9: removeUserTags
public function removeUserTags($ismachine, $key, $contact, $tags)
{
$url = 'https://' . $ismachine . '.infusionsoft.com:443/api/xmlrpc';
$con = new xmlrpc_client($url);
$con->return_type = 'phpvals';
$con->setSSLVerifyHost(0);
$con->setSSLVerifyPeer(0);
//get the tags
$msg = new xmlrpcmsg('ContactService.removeFromGroup');
$msg->addParam(new xmlrpcval($key));
$msg->addParam(new xmlrpcval((int) $contact, 'int'));
$msg->addParam(new xmlrpcval((int) $tags, 'int'));
$t = $con->send($msg);
if ($t->errno) {
$t = array("errno" => $t->errno, "errstr" => $t->errstr);
} else {
$t = array("value" => $t->value());
}
return $t;
}
示例10: InfusionSoft
//.........这里部分代码省略.........
$msg->addParam(new xmlrpcval(0, 'int'));
$msg->addParam(new xmlrpcval(array('Id' => new xmlrpcval($SId, 'int')), 'struct'));
$msg->addParam(new xmlrpcval(array(new xmlrpcval('Id'), new xmlrpcval('ContactId'), new xmlrpcval('OriginatingOrderId'), new xmlrpcval('SubscriptionPlanId'), new xmlrpcval('ProductId'), new xmlrpcval('StartDate'), new xmlrpcval('EndDate'), new xmlrpcval('LastBillDate'), new xmlrpcval('NextBillDate'), new xmlrpcval('ReasonStopped'), new xmlrpcval('Status')), 'array'));
$recur = $con->send($msg);
$recur = $recur->value();
if ($recur) {
return $recur[0];
} else {
return false;
}
}
//function for getting subscription using jobid
function GetSubscriptionStatusByJID($contactID, $JId, $con, $key)
{
$msg = new xmlrpcmsg('DataService.query');
$msg->addParam(new xmlrpcval($key));
$msg->addParam(new xmlrpcval('RecurringOrder'));
$msg->addParam(new xmlrpcval(1, 'int'));
$msg->addParam(new xmlrpcval(0, 'int'));
$msg->addParam(new xmlrpcval(array('ContactId' => new xmlrpcval($contactID), 'OriginatingOrderId' => new xmlrpcval($JId, 'int')), 'struct'));
$msg->addParam(new xmlrpcval(array(new xmlrpcval('Id'), new xmlrpcval('ContactId'), new xmlrpcval('OriginatingOrderId'), new xmlrpcval('SubscriptionPlanId'), new xmlrpcval('ProductId'), new xmlrpcval('StartDate'), new xmlrpcval('EndDate'), new xmlrpcval('LastBillDate'), new xmlrpcval('NextBillDate'), new xmlrpcval('ReasonStopped'), new xmlrpcval('Status')), 'array'));
$recur = $con->send($msg);
$recur = $recur->value();
if ($recur) {
return $recur[0];
} else {
return false;
}
}
function getInvoiceRefunds($con, $key, $invid)
{
$con->return_type = 'phpvals';
$con->setSSLVerifyHost(0);
$con->setSSLVerifyPeer(0);
$msg = new xmlrpcmsg('DataService.query');
$msg->addParam(new xmlrpcval($key));
$msg->addParam(new xmlrpcval('InvoicePayment'));
$msg->addParam(new xmlrpcval(1000, 'int'));
$msg->addParam(new xmlrpcval(0, 'int'));
$msg->addParam(new xmlrpcval(array('InvoiceId' => new xmlrpcval($invid, 'int')), 'struct'));
$msg->addParam(new xmlrpcval(array(new xmlrpcval('Id'), new xmlrpcval('InvoiceId'), new xmlrpcval('Amt'), new xmlrpcval('PayStatus'), new xmlrpcval('PaymentId'), new xmlrpcval('SkipCommission')), 'array'));
$inv_payments = $con->send($msg);
$inv_payments = $inv_payments->value();
$refunded_amount = 0;
if ($inv_payments) {
foreach ($inv_payments as $inv_payment) {
if ($inv_payment['PayStatus'] == 'Refunded') {
$refunded_amount += abs($inv_payment['Amt']);
}
}
}
return $refunded_amount;
}
function isLastInvoicePaid($con, $key, $invoice)
{
//lets get the jobs for the subscription
$jobs = GetSubscriptionJobs($invoice['SubscriptionId'], $con, $key);
if (!$jobs) {
return false;
}
//no job then unpaid
$job_ids = array_map(create_function('$arr', 'return $arr["Id"];'), $jobs);
//we only need the ids
$latest_jobid = max($job_ids);
//get the latest invoice of this subscription
$latest_invoice = getInvoiceByJobId($latest_jobid, $con, $key);
示例11: pingPublishPost
function pingPublishPost()
{
require_once NaverBlogAPI_PLUGIN_PATH . '/lib/xmlrpc.inc';
global $post;
$NaverBlog_Options = get_option('HintsNaverBlogAPI');
$UserName = $NaverBlog_Options['blogapi_id'];
$PassWord = $NaverBlog_Options['blogapi_pw'];
$blogid = $UserName;
$c = new xmlrpc_client($this->XMLRPCURL);
$c->setSSLVerifyPeer(false);
$GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
if ($_POST['excerpt_enable']) {
$content = wpautop(strip_tags(iconv_substr(strip_shortcodes($post->post_content), 0, $_POST['excerpt_lenth'], 'utf-8')));
$content .= ' ..... <br/>[ <a href=' . get_permalink() . '> 더보기 </a> ]';
} else {
$content = wpautop(iconv_substr(do_shortcode($post->post_content), 0, mb_strlen($post->post_content), 'utf-8'));
}
if ($_POST['origin_enable']) {
if ($_POST['origin_posi']) {
$content = '[출처 : <a href=' . get_permalink() . '> ' . get_option("blogname") . ' 원문 보기 </a> ] <br/>' . $content;
} else {
$content = $content . '<br/> [출처 : <a href=' . get_permalink() . '> ' . get_option("blogname") . ' 원문 보기 </a> ]';
}
}
$newpost = new xmlrpcval(array('title' => new xmlrpcval($post->post_title, 'string'), 'description' => new xmlrpcval($content, 'string')), 'struct');
$x = new xmlrpcmsg("metaWeblog.newPost");
$x->addParam(new xmlrpcval($UserName, 'string'));
$x->addParam(new xmlrpcval($blogid, 'string'));
$x->addParam(new xmlrpcval($PassWord, 'string'));
$x->addParam($newpost);
$x->addParam(new xmlrpcval(true, 'boolean'));
$x->request_charset_encoding = "UTF-8";
$c->return_type = 'phpvals';
$r = $c->send($x, 3, 'https');
}
示例12: xmlrpcmsg
include "lib/xmlrpc_wrappers.inc";
$orderNumber = $_GET['orderNumber'];
$user = 'admin';
$password = 'topvalue';
$dbname = 'magento_dev';
$server_url = 'http://52.77.224.23:8069';
$client = new xmlrpc_client($server_url . "/xmlrpc/common");
$client->setSSLVerifyPeer(0);
$c_msg = new xmlrpcmsg('login');
$c_msg->addParam(new xmlrpcval($dbname, "string"));
$c_msg->addParam(new xmlrpcval($user, "string"));
$c_msg->addParam(new xmlrpcval($password, "string"));
$c_response = $client->send($c_msg);
$uid = $c_response->value()->scalarval();
$client = new xmlrpc_client($server_url . "/xmlrpc/object");
$client->setSSLVerifyPeer(0);
$key1 = array(new xmlrpcval($orderNumber, 'int'));
$key = array(new xmlrpcval(array(new xmlrpcval('origin', "string"), new xmlrpcval('in', "string"), new xmlrpcval($key1, "array")), "array"));
$msg_ser = new xmlrpcmsg('execute');
$msg_ser->addParam(new xmlrpcval($dbname, "string"));
$msg_ser->addParam(new xmlrpcval($uid, "int"));
$msg_ser->addParam(new xmlrpcval($password, "string"));
$msg_ser->addParam(new xmlrpcval("sale.order", "string"));
$msg_ser->addParam(new xmlrpcval("search", "string"));
$msg_ser->addParam(new xmlrpcval($key, "array"));
$resp0 = $client->send($msg_ser);
$value_array = $resp0->value()->me['array'];
// $value_array = $resp0->value()->scalarval();
$order_id = $value_array[0]->me['int'];
// echo"<pre>";print_r($order_id);die;
$key1 = array(new xmlrpcval($order_id, 'int'));
示例13: AutoResponderInfusionsoft
function AutoResponderInfusionsoft($that, $ar, $wpm_id, $email, $unsub = false)
{
global $WishListMemberInstance;
if (!class_exists('xmlrpcmsg') || !class_exists('xmlrpcval') || !class_exists('xmlrpc_client')) {
include_once $x = $WishListMemberInstance->pluginDir . '/extlib/xmlrpc.php';
}
$iskey = $ar['iskey'];
// get the Infusionsoft API
$ismname = $ar['ismname'];
// get the Infusionsoft API
$cID = $ar['isCID'][$wpm_id];
// get the campaign ID of the Membership Level
$isUnsub = $ar['isUnsub'][$wpm_id] == 1 ? true : false;
// check if we will unsubscribe or not
if ($cID) {
//$listID should not be empty
list($fName, $lName) = explode(" ", $that->ARSender['name'], 2);
//split the name into First and Last Name
$emailAddress = $that->ARSender['email'];
//create connection
$url = 'https://' . $ismname . '.infusionsoft.com:443/api/xmlrpc';
$con = new xmlrpc_client($url);
$con->return_type = 'phpvals';
$con->setSSLVerifyHost(0);
$con->setSSLVerifyPeer(0);
//check if the user is already in the database
$returnFields = array('Id');
$carray = array(php_xmlrpc_encode($iskey), php_xmlrpc_encode($emailAddress), php_xmlrpc_encode($returnFields));
$call = new xmlrpcmsg('ContactService.findByEmail', $carray);
$dups = $con->send($call);
if (!$dups->faultCode()) {
$dups = $dups->value();
$personId = $dups[0]['Id'];
}
if ($unsub) {
// if the Unsubscribe
//if email is found, remove it from campaign and if it will be unsubscribe once remove from level
if (!empty($personId) && $isUnsub) {
$msg = new xmlrpcmsg('ContactService.removeFromCampaign');
$msg->addParam(new xmlrpcval($iskey));
$msg->addParam(new xmlrpcval((int) $personId, 'int'));
$msg->addParam(new xmlrpcval((int) $cID, 'int'));
$res = $con->send($msg);
if (!$res->faultCode()) {
$res = $res->value();
}
}
} else {
//else Subscribe
//if email is existing, assign it to the campaign
if (!empty($personId)) {
$msg = new xmlrpcmsg('APIEmailService.optIn');
$msg->addParam(new xmlrpcval($iskey));
$msg->addParam(new xmlrpcval($emailAddress));
$msg->addParam(new xmlrpcval("WishList Member Autoresponde Integration Optin"));
$res = $con->send($msg);
$msg = new xmlrpcmsg('ContactService.addToCampaign');
$msg->addParam(new xmlrpcval($iskey));
$msg->addParam(new xmlrpcval((int) $personId, 'int'));
$msg->addParam(new xmlrpcval((int) $cID, 'int'));
$res = $con->send($msg);
if (!$res->faultCode()) {
$res = $res->value();
}
} else {
//if email is new, assign it to the add it to the database
$msg = new xmlrpcmsg('ContactService.add');
$msg->addParam(new xmlrpcval($iskey));
$msg->addParam(new xmlrpcval(array('Email' => new xmlrpcval($emailAddress), 'FirstName' => new xmlrpcval($fName), 'LastName' => new xmlrpcval($lName)), 'struct'));
$newId = $con->send($msg);
// if successfully addded, opt-in the contact
if (!$newId->faultCode()) {
$newId = $newId->value();
$msg = new xmlrpcmsg('APIEmailService.optIn');
$msg->addParam(new xmlrpcval($iskey));
$msg->addParam(new xmlrpcval($emailAddress));
$msg->addParam(new xmlrpcval("WishList Member Autoresponde Integration Optin"));
$res = $con->send($msg);
if (!$res->faultCode()) {
$res = $res->value();
}
//then assign it to the campaign
$msg = new xmlrpcmsg('ContactService.addToCampaign');
$msg->addParam(new xmlrpcval($iskey));
$msg->addParam(new xmlrpcval((int) $newId, 'int'));
$msg->addParam(new xmlrpcval((int) $cID, 'int'));
$res = $con->send($msg);
if (!$res->faultCode()) {
$res = $res->value();
}
}
}
}
}
}
示例14: workflow
public function workflow($model, $method, $record_id)
{
$client = new xmlrpc_client($this->server . "object");
$client->setSSLVerifyPeer(0);
$client->return_type = 'phpvals';
$msg = new xmlrpcmsg('exec_workflow');
$msg->addParam(new xmlrpcval($this->database, "string"));
//* database name */
$msg->addParam(new xmlrpcval($this->uid, "int"));
/* useid */
$msg->addParam(new xmlrpcval($this->password, "string"));
/** password */
$msg->addParam(new xmlrpcval($model, "string"));
/** model name where operation will held * */
$msg->addParam(new xmlrpcval($method, "string"));
/** method which u like to execute */
$msg->addParam(new xmlrpcval($record_id, "int"));
/** parameters of the methods with values.... */
$resp = $client->send($msg);
if ($resp->faultCode()) {
return -1;
} else {
return $resp->value();
}
/* return new generated id of record */
}
示例15: xmlrpc_wrapper
/**
* @param $host
* @param $msg
* @return xmlrpcresp
*/
function xmlrpc_wrapper($host, $msg)
{
$method = 'http';
// Work out port
if (defined('SSL_ONLY') && SSL_ONLY) {
$port = 443;
$method = 'https';
} elseif (defined('RPC_PORT')) {
$port = RPC_PORT;
if (defined('RPC_SSL') && RPC_SSL) {
$method = 'https';
if (!defined('RPC_PORT')) {
$port = 443;
}
}
} else {
$port = 80;
}
$client = new xmlrpc_client(constant('RPC_RELATIVE_PATH') . '/rpcserver.php', $host, $port);
if (DEBUG) {
$client->setDebug(1);
}
$client->setSSLVerifyPeer(0);
$client->setSSLVerifyHost(0);
$response = $client->send($msg, 0, $method);
return $response;
}