request() public static method

This statically called method is actually the RPC client.
public static request ( string $driver, string | Horde_Url $url, string $method, mixed $client, array $params = null ) : mixed
$driver string The protocol driver to use. Currently 'soap', 'xmlrpc' and 'jsonrpc' are available.
$url string | Horde_Url The path to the RPC server on the called host.
$method string The method to call.
$client mixed An appropriate request client for the type of request. (Horde_Http_Request, SoapClient etc..)
$params array A hash containing any necessary parameters for the method call.
return mixed The returned result from the method
示例#1
0
文件: Whups.php 项目: horde/horde
 /**
  * Performs a listQueue API call.
  *
  * @throws Horde_Exception
  * @return array  List of queues with IDs as key and information hash as
  *                value.
  */
 protected function _listQueues()
 {
     return Horde_Rpc::request('jsonrpc', $this->_params['url'], 'tickets.listSlugs', $this->_http, null)->result;
 }
示例#2
0
function post_comment($ticket, $log_message)
{
    $http = new Horde_Http_Client($GLOBALS['rpc_options']);
    try {
        $result = Horde_Rpc::request('xmlrpc', $GLOBALS['rpc_endpoint'], $GLOBALS['rpc_method'], $http, array((int) $ticket, $log_message));
    } catch (Horde_Http_Exception $e) {
        abort($e->getMessage());
    } catch (Horde_Rpc_Exception $e) {
        // Ignore
    }
    return true;
}
示例#3
0
文件: soap.php 项目: jubinpatel/horde
<?php

/**
 * @package Rpc
 */
die("Please configure the URL, username, and password, and then remove this line.\n");
// SOAP endpoint
$rpc_endpoint = 'http://example.com/horde/rpc.php';
// SOAP method to call
$rpc_method = 'calendar.listCalendars';
// SOAP options, usually username and password
$rpc_options = array('login' => '', 'password' => '', 'namespace' => 'urn:horde', 'timeout' => 5, 'allowRedirects' => true, 'maxRedirects' => 3, 'location' => $rpc_endpoint, 'uri' => 'urn:horde', 'exceptions' => true, 'trace' => true);
$soap = new SoapClient(null, $rpc_options);
$result = Horde_Rpc::request('soap', $GLOBALS['rpc_endpoint'], $GLOBALS['rpc_method'], $soap, array());
var_dump($result);
示例#4
0
<?php

/**
 * @package Rpc
 */
die("Please configure the URL, username, and password, and then remove this line.\n");
// XML-RPC endpoint
$rpc_endpoint = 'http://example.com/horde/rpc.php';
// XML-RPC method to call
$rpc_method = 'calendar.listCalendars';
// XML-RPC options, usually username and password
$rpc_options = array('request.username' => '', 'request.password' => '');
$http_client = new Horde_Http_Client($rpc_options);
$result = Horde_Rpc::request('xmlrpc', $GLOBALS['rpc_endpoint'], $GLOBALS['rpc_method'], $GLOBALS['http_client'], array());
var_dump($result);