當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IXR_Client::getResponse方法代碼示例

本文整理匯總了PHP中IXR_Client::getResponse方法的典型用法代碼示例。如果您正苦於以下問題:PHP IXR_Client::getResponse方法的具體用法?PHP IXR_Client::getResponse怎麽用?PHP IXR_Client::getResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IXR_Client的用法示例。


在下文中一共展示了IXR_Client::getResponse方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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;
 }
開發者ID:laiello,項目名稱:litepublisher,代碼行數:57,代碼來源:livejournalposter.php

示例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();
 }
開發者ID:vih-elevforening,項目名稱:elevforeningen.vih.dk,代碼行數:8,代碼來源:ContactClient.php

示例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();
 }
開發者ID:vih-elevforening,項目名稱:elevforeningen.vih.dk,代碼行數:8,代碼來源:DebtorClient.php

示例4: send

 /**
  * Envía mensajes a un array de destinatarios
  * 
  * El array de entrada debe ser:
  * 
  * $mensajes = array(
  *                array('637xxxxxx','texto del mensaje','texto que identifica al enviador'),
  *                //array(),
  *             );
  * 
  * @param array $mensajes
  * @return array
  */
 static function send(array $mensajes)
 {
     if (count($mensajes)) {
         $client = new IXR_Client(self::$url);
         $client->query('MensajeriaNegocios.enviarSMS', self::$user, self::$passw, $mensajes);
         return $client->getResponse();
     }
 }
開發者ID:albatronic,項目名稱:agentescloud,代碼行數:21,代碼來源:SMS.class.php

示例5: placeOrder

 /**
  * Funktionen sender ordren til systemet
  *
  * @param $order (array)
  * $order['company'] = $_POST['navn'];
  * $order['contactname'] = $_POST['navn'];
  * $order['address'] = $_POST['adresse'];
  * $order['postalcode'] = $_POST['postnr'];
  * $order['town'] = $_POST['bynavn'];
  * $order['email'] = $_POST['email'];
  * $order['phone'] = $_POST['telefonnummer'];
  * @access public
  */
 function placeOrder($order)
 {
     if (!($id = $this->client->query('basket.placeOrder', $this->credentials, $order))) {
         //if (!$client->query('products.test', $args)) {
         trigger_error('An error occurred - ' . $this->client->getErrorCode() . ":" . $this->client->getErrorMessage());
     }
     return $this->client->getResponse();
 }
開發者ID:vih-elevforening,項目名稱:elevforeningen.vih.dk,代碼行數:21,代碼來源:WebshopClient.php

示例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());
 }
開發者ID:r8-forks,項目名稱:Picora,代碼行數:15,代碼來源:PicoraXMLRPC.php

示例7: action

 /**
  * Performs and action for the executed test case (i.e. sets the status of test case)
  *
  * @param string    $method
  * @param array     $args
  *
  * @return array
  */
 protected function action($method, $args)
 {
     $args["devKey"] = Mage_Testlink_Connector::$devKey;
     if (!$this->_client->query("tl.{$method}", $args)) {
         $response = null;
     } else {
         $response = $this->_client->getResponse();
     }
     return $response;
 }
開發者ID:venkateshcontus,項目名稱:taf,代碼行數:18,代碼來源:Connector.php

示例8: rpc

 public static function rpc($url)
 {
     new Pinger();
     //require_once( GX_LIB.'/Vendor/IXR_Library.php' );
     $url = 'http://' . $url;
     $client = new IXR_Client($url);
     $client->timeout = 3;
     $client->useragent .= ' -- PingTool/1.0.0';
     $client->debug = false;
     if ($client->query('weblogUpdates.extendedPing', self::$myBlogName, self::$myBlogUrl, self::$myBlogUpdateUrl, self::$myBlogRSSFeedUrl)) {
         return $client->getResponse();
     }
     //echo 'Failed extended XML-RPC ping for "' . $url . '": ' . $client->getErrorCode() . '->' . $client->getErrorMessage() . '<br />';
     if ($client->query('weblogUpdates.ping', self::$myBlogName, self::$myBlogUrl)) {
         return $client->getResponse();
     }
     //echo 'Failed basic XML-RPC ping for "' . $url . '": ' . $client->getErrorCode() . '->' . $client->getErrorMessage() . '<br />';
     return false;
 }
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:19,代碼來源:Pinger.class.php

示例9:

 /**
  * 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;
     }
 }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:20,代碼來源:OutputThis.php

示例10: 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;
}
開發者ID:Peter2121,項目名稱:leonardoxc,代碼行數:16,代碼來源:FN_flight.php

示例11: 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);
 }
開發者ID:niko-lgdcom,項目名稱:archives,代碼行數:53,代碼來源:Netdna.php

示例12: getNamespace

 private function getNamespace($server, $check_method)
 {
     if (empty($this->methods)) {
         $client = new \IXR_Client("http://{$server}:9001/RPC2/");
         //	$client->debug = true;
         if (!$client->query('system.listMethods')) {
             return false;
         } else {
             $methods = $client->getResponse();
             foreach ($methods as $method) {
                 $parts = explode('.', $method);
                 $this->methods[$parts[1]] = $parts[0];
             }
         }
     }
     return $this->methods[$check_method];
 }
開發者ID:jbinfo,項目名稱:supervisorui,代碼行數:17,代碼來源:API.php

示例13: 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;
}
開發者ID:Vytek,項目名稱:vrylbot,代碼行數:18,代碼來源:getUpdates.php

示例14: 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

示例15: ljxp_delete

function ljxp_delete($post_id)
{
    // Pull the post_id
    $ljxp_post_id = get_post_meta($post_id, 'ljID', true);
    $errors = array();
    // Ensures that there's actually a value. If the post was never
    // cross-posted, the value wouldn't be set, and there's no point in
    // deleting entries that don't exist
    if ($ljxp_post_id == 0) {
        return $post_id;
    }
    $options = ljxp_get_options();
    // And open the XMLRPC interface
    $client = new IXR_Client($options['host'], '/interface/xmlrpc');
    // Request the challenge for authentication
    if (!$client->query('LJ.XMLRPC.getchallenge')) {
        $errors[$client->getErrorCode()] = $client->getErrorMessage();
    }
    // And retrieve the challenge that LJ returns
    $response = $client->getResponse();
    $challenge = $response['challenge'];
    // Most of this is the same as before. The important difference is the
    // value of $args[event]. By setting it to a null value, LJ deletes the
    // entry. Really rather klunky way of doing things, but not my code!
    $args = array('username' => $options['username'], 'auth_method' => 'challenge', 'auth_challenge' => $challenge, 'auth_response' => md5($challenge . $options['password']), 'itemid' => $ljxp_post_id, 'event' => "", 'subject' => "Delete this entry", 'year' => date('Y'), 'mon' => date('n'), 'day' => date('j'), 'hour' => date('G'), 'min' => date('i'), 'usejournal' => !empty($options['community']) ? $options['community'] : $options['username']);
    // And awaaaayyy we go!
    if (!$client->query('LJ.XMLRPC.editevent', $args)) {
        $errors[$client->getErrorCode()] = $client->getErrorMessage();
    }
    delete_post_meta($post_id, 'ljID');
    delete_post_meta($post_id, 'ljURL');
    update_option('ljxp_error_notice', $errors);
    return $post_id;
}
開發者ID:laiello,項目名稱:ljxp,代碼行數:34,代碼來源:lj-xp.php


注:本文中的IXR_Client::getResponse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。