本文整理匯總了PHP中IXR_Client::getErrorMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP IXR_Client::getErrorMessage方法的具體用法?PHP IXR_Client::getErrorMessage怎麽用?PHP IXR_Client::getErrorMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IXR_Client
的用法示例。
在下文中一共展示了IXR_Client::getErrorMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __call
public function __call($action, $arguments)
{
@(list($server, $option) = $arguments);
if ($action == 'multicall') {
$client = new \IXR_ClientMulticall("http://{$server}:9001/RPC2/");
$client->debug = true;
foreach ((array) $option as $method) {
$client->addCall($this->getNamespace($server, $action) . '.' . $method);
}
if (!$client->query()) {
return array('error' => array('code' => $client->getErrorCode(), 'msg' => $client->getErrorMessage()));
}
} else {
$args = array($this->getNamespace($server, $action) . '.' . $action);
if ($option) {
$args[] = $option;
}
$client = new \IXR_Client("http://{$server}:9001/RPC2/");
//$client->debug = true;
if (!call_user_func_array(array($client, 'query'), $args)) {
return array('error' => array('code' => $client->getErrorCode(), 'msg' => $client->getErrorMessage()));
}
}
return $client->getResponse();
}
示例2: getConnectedKeywords
function getConnectedKeywords($id)
{
if (!$this->client->query('contact.getConnectedKeywords', $this->credentials, $id)) {
trigger_error($this->client->getErrorCode() . ' : ' . $this->client->getErrorMessage());
return false;
}
return $this->client->getResponse();
}
示例3: capturePayment
function capturePayment($transactionnumber)
{
if (!$this->client->query('payment.capture', $this->credentials, $transactionnumber)) {
print $this->client->getErrorCode() . ' : ' . $this->client->getErrorMessage();
return false;
}
return $this->client->getResponse();
}
示例4: addOnlinePayment
function addOnlinePayment($order_id, $transaction_number, $transaction_status, $amount)
{
if (!$this->client->query('payment.addOnlinePayment', $this->credentials, $order_id, $transaction_number, $transaction_status, $amount)) {
//if (!$client->query('products.test', $args)) {
trigger_error('An error occurred - ' . $this->client->getErrorCode() . ":" . $this->client->getErrorMessage());
}
return 1;
}
示例5: sendpost
public function sendpost($id)
{
if ($this->host == '' || $this->login == '') {
return false;
}
$post = tpost::i($id);
ttheme::$vars['post'] = $post;
$theme = ttheme::i();
$content = $theme->parse($this->template);
$date = getdate($post->posted);
if ($post->status != 'published') {
return;
}
$meta = $post->meta;
$client = new IXR_Client($this->host, '/interface/xmlrpc');
//$client = new IXR_Client($this->host, '/rpc.xml');
if (!$client->query('LJ.XMLRPC.getchallenge')) {
if (litepublisher::$debug) {
tfiler::log('live journal: error challenge');
}
return false;
}
$response = $client->getResponse();
$challenge = $response['challenge'];
$args = array('username' => $this->login, 'auth_method' => 'challenge', 'auth_challenge' => $challenge, 'auth_response' => md5($challenge . md5($this->password)), 'ver' => "1", 'event' => $content, 'subject' => $post->title, 'year' => $date['year'], 'mon' => $date['mon'], 'day' => $date['mday'], 'hour' => $date['hours'], 'min' => $date['minutes'], 'props' => array('opt_nocomments' => !$post->commentsenabled, 'opt_preformatted' => true, 'taglist' => $post->tagnames));
switch ($this->privacy) {
case "public":
$args['security'] = "public";
break;
case "private":
$args['security'] = "private";
break;
case "friends":
$args['security'] = "usemask";
$args['allowmask'] = 1;
}
if ($this->community != '') {
$args['usejournal'] = $this->community;
}
if (isset($meta->ljid)) {
$method = 'LJ.XMLRPC.editevent';
$args['itemid'] = $meta->ljid;
} else {
$method = 'LJ.XMLRPC.postevent';
}
if (!$client->query($method, $args)) {
if (litepublisher::$debug) {
tfiler::log('Something went wrong - ' . $client->getErrorCode() . ' : ' . $client->getErrorMessage());
}
return false;
}
if (!isset($meta->ljid)) {
$response = $client->getResponse();
$meta->ljid = $response['itemid'];
}
return $meta->ljid;
}
示例6: call
/**
* This method is similar to call_user_func() in that you can pass any number of arguments beyond the required two, which will then call the remote XMLRPC method.
* @param string $url
* @param string $method
* @return array (bool success,mixed response)
*/
function call($url, $method)
{
$client = new IXR_Client($url);
if (defined('DEBUG_XMLRPC')) {
$client->debug = true;
}
$args = func_get_args();
return !call_user_func_array(array($client, 'query'), array($method) + array_slice($args, 1)) ? array(false, $client->getErrorCode() . ' : ' . $client->getErrorMessage()) : array(true, $client->getResponse());
}
示例7: send
public function send($post, $blogurl, $username, $password)
{
if ($post && $blogurl && $username && $password) {
$title = $post['title'];
$description = $post['body'];
$selected_blog = $blogurl . "/xmlrpc.php";
$client = new IXR_Client("{$selected_blog}");
$content['title'] = $title;
$content['description'] = $description;
if (!$client->query('metaWeblog.newPost', '1', $username, $password, $content, 1)) {
die('Something went wrong - ' . $client->getErrorCode() . ' : ' . $client->getErrorMessage());
}
}
}
示例8:
/**
* sends targets from OutputThis.
*
* @param integer id of destination.
*/
static function get_targets($username, $password)
{
Logger::log("Enter: function OutputThis::get_targets()");
$client = new IXR_Client('http://outputthis.org/xmlrpc.php');
if (!$client->query('outputthis.getPublishedTargets', $username, $password)) {
$error[0] = 'error';
$error[1] = 'Something went wrong - ' . $client->getErrorCode() . ' : ' . $client->getErrorMessage();
Logger::log("Exit: function OutputThis::get_targets()-Error in getting information from output this");
return $error;
} else {
$targets = $client->getResponse();
Logger::log("Exit: function OutputThis::get_targets()-getting information from outputthis successful");
return $targets;
}
}
示例9: submitFlightToServer
function submitFlightToServer($serverURL, $username, $passwd, $igcURL, $igcFilename, $private, $cat, $linkURL, $comments, $glider)
{
require_once dirname(__FILE__) . "/lib/xml_rpc/IXR_Library.inc.php";
$client = new IXR_Client($serverURL);
// $client->debug=true;
// echo "$username, $passwd, $igcURL, $igcFilename, $private, $cat, $linkURL, $comments, $glider #<BR>";
if (!$client->query('flights.submit', $username, $passwd, $igcURL, $igcFilename, $private, $cat, $linkURL, $comments, $glider)) {
//echo 'submitFlightToServer: Error '.$client->getErrorCode()." -> ".$client->getErrorMessage();
return array(0, $client->getErrorCode(), $client->getErrorMessage());
} else {
$flightID = $client->getResponse();
return array($flightID, '', '');
// echo 'Flight was submited with id '.$flightID;
}
// return $flightID;
}
示例10: purge
/**
* Purges remote files
*
* @param array $files
* @param array $results
* @return boolean
*/
function purge($files, &$results)
{
if (empty($this->_config['apiid'])) {
$results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, 'Empty API ID.');
return false;
}
if (empty($this->_config['apikey'])) {
$results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, 'Empty API key.');
return false;
}
if ($this->_sha256('test') === false) {
$results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, "hash() or mhash() function doesn't exists.");
return false;
}
if (!class_exists('IXR_Client')) {
require_once ABSPATH . WPINC . '/class-IXR.php';
}
if (function_exists('date_default_timezone_set')) {
$timezone = date_default_timezone_get();
date_default_timezone_set(W3TC_CDN_MIRROR_NETDNA_TZ);
}
$date = date('c');
$auth_string = sprintf('%s:%s:purge', $date, $this->_config['apikey']);
$auth_key = $this->_sha256($auth_string);
$client = new IXR_Client(W3TC_CDN_MIRROR_NETDNA_URL);
$client->timeout = 30;
$results = array();
foreach ($files as $local_path => $remote_path) {
$url = $this->format_url($remote_path);
$client->query('cache.purge', $this->_config['apiid'], $auth_key, $date, $url);
if (!$client->isError()) {
$val = $client->getResponse();
if ($val) {
$results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_OK, 'OK');
} else {
$results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, 'Unable to purge.');
}
} else {
$results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_HALT, sprintf('Unable to purge (%s).', $client->getErrorMessage()));
}
}
if (function_exists('date_default_timezone_set')) {
date_default_timezone_set($timezone);
}
return !$this->_is_error($results);
}
示例11: get_palina
function get_palina($palina_id, $api_key)
{
// mi autentico per ottenere il token
$client = new IXR_Client("http://muovi.roma.it/ws/xml/autenticazione/1");
if (!$client->query('autenticazione.Accedi', $api_key, '')) {
echo '<br>An error occurred - ' . $client->getErrorCode() . ":" . $client->getErrorMessage();
}
$token = $client->getResponse();
// mostra il token
//echo "<br><br>TOKEN-> ".$token;
// richiamo il ws per la ricerca del percorso
$client = new IXR_Client("http://muovi.roma.it/ws/xml/paline/7");
if (!$client->query('paline.Previsioni', $token, (int) $palina_id, "it")) {
echo '<br>An error occurred - ' . $client->getErrorCode() . ":" . $client->getErrorMessage();
}
$response = $client->getResponse();
return $response;
}
示例12: api_request
/**
* api_request
*
* Handles any request made to the Syndication Toolkit Master wordpress install via cURL
*
* @param string $method
* @param array $params
* @return mixed $results
* @access public
* @author Ben Moody
*/
public function api_request($method, $params)
{
//Init vars
$client = NULL;
$results = NULL;
$request = NULL;
$ch = NULL;
$results = NULL;
$response_code = NULL;
$errorno = NULL;
$error = NULL;
//include Incutio XML-RPC Library from wordpress core
require PRSOSYNDTOOLKITREADER__XMLRPC_LIB;
$client = new IXR_Client($this->xml_rpc_url);
if (!$client->query($method, $params, $this->username, $this->password)) {
return array('errorCode' => $client->getErrorCode(), 'errorMsg' => $client->getErrorMessage());
}
$results = $client->getResponse();
return $results;
}
開發者ID:anthonyeden,項目名稱:prso-content-syndication-toolkit-reader,代碼行數:31,代碼來源:class.prso-syd-reader-xmlrpc.php
示例13: die
<?php
require "functions/xmlrpc.php";
$client = new IXR_Client('http://192.168.1.2/denial/rpc.php');
$client->debug = true;
if (!$client->query('blogger.getUsersBlogs', "943478217472357234234938249", "Kevin", "heh")) {
die('<b>Error</b> ' . $client->getErrorCode() . ' : ' . $client->getErrorMessage());
} else {
$response = $client->getresponse();
}
示例14: get_language
function get_language()
{
global $prefs, $txpcfg, $textarray;
require_once txpath . '/lib/IXRClass.php';
$lang_code = gps('lang_code');
$client = new IXR_Client(RPC_SERVER);
// $client->debug = true;
@set_time_limit(90);
if (gps('force') == 'file' || !$client->query('tups.getLanguage', $prefs['blog_uid'], $lang_code)) {
if ((gps('force') == 'file' || gps('updating') !== '1') && install_language_from_file($lang_code)) {
if (defined('LANG')) {
$textarray = load_lang(LANG);
}
return list_languages(gTxt($lang_code) . sp . gTxt('updated'));
} else {
$install_langfile = gTxt('install_langfile', array('{url}' => strong('<a href="' . RPC_SERVER . '/lang/">' . RPC_SERVER . '/lang/</a>')));
if ($install_langfile == 'install_langfile') {
$install_langfile = 'To install new languages from file you can download them from <b><a href="' . RPC_SERVER . '/lang/">' . RPC_SERVER . '/lang/</a></b> and place them inside your ./textpattern/lang/ directory.';
}
pagetop(gTxt('installing_language'));
echo tag(gTxt('rpc_connect_error') . "<!--" . $client->getErrorCode() . ' ' . $client->getErrorMessage() . "-->", 'p', ' style="text-align:center;color:red;width:50%;margin: 2em auto"');
echo tag($install_langfile, 'p', ' style="text-align:center;width:50%;margin: 2em auto"');
}
} else {
$response = $client->getResponse();
$lang_struct = unserialize($response);
function install_lang_key(&$value, $key)
{
extract(gpsa(array('lang_code', 'updating')));
$exists = safe_field('name', 'txp_lang', "name='" . doSlash($value['name']) . "' AND lang='" . doSlash($lang_code) . "'");
$q = "name='" . doSlash($value['name']) . "', event='" . doSlash($value['event']) . "', data='" . doSlash($value['data']) . "', lastmod='" . doSlash(strftime('%Y%m%d%H%M%S', $value['uLastmod'])) . "'";
if ($exists) {
$value['ok'] = safe_update('txp_lang', $q, "lang='" . doSlash($lang_code) . "' AND name='" . doSlash($value['name']) . "'");
} else {
$value['ok'] = safe_insert('txp_lang', $q . ", lang='" . doSlash($lang_code) . "'");
}
}
array_walk($lang_struct, 'install_lang_key');
$size = count($lang_struct);
$errors = 0;
for ($i = 0; $i < $size; $i++) {
$errors += !$lang_struct[$i]['ok'];
}
if (defined('LANG')) {
$textarray = load_lang(LANG);
}
$msg = gTxt($lang_code) . sp . gTxt('updated');
if ($errors > 0) {
$msg .= sprintf(" (%s errors, %s ok)", $errors, $size - $errors);
}
return list_languages($msg);
}
}
示例15: get_cast_mdata_pull
function get_cast_mdata_pull($ctx_age, $cast_mdata_ctx)
{
$cast_name = $cast_mdata_ctx['name'];
// sanity check - $cast_mdata_ctx['type'] MUST be "pull"
assert($cast_mdata_ctx['type'] == "pull");
do_log("slota");
do_log("ctx_age=" . $ctx_age);
do_log("cast_mdata_ctx=" . print_r($cast_mdata_ctx, true));
// get the casti_srv_uri directly from $cast_mdata_ctx['arg'];
$casti_srv_uri = $cast_mdata_ctx['arg'];
// forward the xmlrpc to casti_srv_uri
$client = new IXR_Client($casti_srv_uri);
// $client->debug = true;
if (!$client->query('get_cast_mdata', $cast_name)) {
// delete the context file if it is now unreachable
// unlink(cast_name_to_filepath($cast_name));
// forward the error to the caller
return new IXR_Error($client->getErrorCode(), "slotaIXR" . $client->getErrorMessage());
}
// get the cast_mdata
$cast_mdata = $client->getResponse();
// return the $cast_mdata
return $cast_mdata;
}