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


PHP Zend_XmlRpc_Client::getProxy方法代码示例

本文整理汇总了PHP中Zend_XmlRpc_Client::getProxy方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Client::getProxy方法的具体用法?PHP Zend_XmlRpc_Client::getProxy怎么用?PHP Zend_XmlRpc_Client::getProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_XmlRpc_Client的用法示例。


在下文中一共展示了Zend_XmlRpc_Client::getProxy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: xmlrpcgetuserlistAction

	/**
	 * XMLRPC user list
	 */
	public function xmlrpcgetuserlistAction() 
	{
		$client = new Zend_XmlRpc_Client('http://front.zend.local/Wsserver/index/xmlrpc');
		
		$systemService = $client->getProxy('system');
		
		$userService = $client->getProxy('user');
		
		$string = $userService->testString();
		var_dump( $string ); 
		
		$object = $userService->testObject();
		var_dump( $object ); 
		
		$array = $userService->testArray();
		var_dump( $array ); 
		
		$array = $userService->testArray2();
		var_dump( $array );
		
		$arrayOfOjects = $userService->listUsers();
		var_dump( $arrayOfOjects ); 
		
		$methods = $systemService->listMethods();
		print_r( $methods );
		
		$help = $systemService->methodSignature( 'user.authenticate' );
		print_r( $help );
		exit;
	}
开发者ID:neotok,项目名称:front,代码行数:33,代码来源:indexController.php

示例2: deleteTicket

 public function deleteTicket($id)
 {
     $proxy = $this->_client->getProxy('ticket');
     // int ticket.delete(int id)
     $result = $proxy->delete($id);
     return $result === 0;
 }
开发者ID:r3wald,项目名称:trac-cli,代码行数:7,代码来源:Trac.php

示例3: testServerProxyCachesNestedProxies

 public function testServerProxyCachesNestedProxies()
 {
     $proxy = $this->xmlrpcClient->getProxy();
     $foo = $proxy->foo;
     $this->assertSame($foo, $proxy->foo);
     $bar = $proxy->foo->bar;
     $this->assertSame($bar, $proxy->foo->bar);
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:8,代码来源:ClientTest.php

示例4: xmlrpcConsoleAction

 public function xmlrpcConsoleAction()
 {
     $serverUrl = str_replace('console', 'server', MAIN_URL . $this->getRequest()->getRequestUri());
     $client = new Zend_XmlRpc_Client($serverUrl);
     $example = $client->getProxy('example');
     echo $example->getTime();
     exit;
 }
开发者ID:erider,项目名称:basezf,代码行数:8,代码来源:ServiceController.php

示例5: __construct

 /**
  * Create a new connection to a R1soft server.
  *
  * @param string $host Hostname or IP address of the R1soft server.
  * @param string $username
  * @param string $password
  * @param bool $secure Use HTTPS
  */
 public function __construct( $host, $username, $password, $secure = true ) {
   if( $secure ) {
     $this->_fullUrl = sprintf( 'https://%s:%s@%s:%d/xmlrpc', $username,
                                $password, $host, self::PORT_SECURE );
   $this->_client = new Zend_XmlRpc_Client( $this->_fullUrl,
     new Zend_Http_Client( null, array(
       'ssltransport'  => 'sslv3', //ssl does not properly detect v3
     ) ) );
   } else {
     $this->_fullUrl = sprintf( 'http://%s:%s@%s:%s/xmlrpc', $username,
                                $password, $host, self::PORT_UNSECURE );
     $this->_client = new Zend_XmlRpc_Client( $this->_fullUrl );
   }
   $this->_proxy = $this->_client->getProxy();
   $this->_testConnection();
 }
开发者ID:nexcess,项目名称:libr1soft2,代码行数:24,代码来源:Remote.php

示例6: get_xmlrpc

/**
 * This returns a Zend_XmlRpc_Client instance - unless we can't log you in...
 */
function get_xmlrpc()
{
    global $CONF;
    require_once 'Zend/XmlRpc/Client.php';
    $client = new Zend_XmlRpc_Client($CONF['xmlrpc_url']);
    $http_client = $client->getHttpClient();
    $http_client->setCookieJar();
    $login_object = $client->getProxy('login');
    if (empty($_SESSION['password'])) {
        if (empty($_POST['password'])) {
            _display_password_form();
            exit(0);
        } else {
            try {
                $success = $login_object->login($_SESSION['username'], $_POST['password']);
            } catch (Exception $e) {
                //var_dump($client->getHttpClient()->getLastResponse()->getBody());
                error_log("Failed to login to xmlrpc instance - " . $e->getMessage());
                die('Failed to login to xmlrpc instance');
            }
            if ($success) {
                $_SESSION['password'] = $_POST['password'];
                // reload the current page as a GET request.
                header("Location: {$_SERVER['REQUEST_URI']}");
                exit(0);
            } else {
                _display_password_form();
                exit(0);
            }
        }
    } else {
        $success = $login_object->login($_SESSION['username'], $_SESSION['password']);
    }
    if (!$success) {
        unset($_SESSION['password']);
        die("Invalid details cached... refresh this page and re-enter your mailbox password");
    }
    return $client;
}
开发者ID:mpietruschka,项目名称:postfixadmin,代码行数:42,代码来源:functions.inc.php

示例7: post

 public static function post($message)
 {
     // получаем конфиг из application.ini
     try {
         $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'lj');
     } catch (Exception $e) {
         throw new Exception('Config load error. Check your application.ini. ' . $e);
     }
     // создаем новый объект класса Zend_XmlRpc_Client и передаем ему адрес сервера
     $client = new Zend_XmlRpc_Client('http://www.livejournal.com/interface/xmlrpc');
     // получаем объект прокси, при этом передаем ему пространство имен
     $proxy = $client->getProxy('LJ.XMLRPC');
     try {
         //получаем challenge для авторизации
         $challenge = $proxy->getchallenge();
     } catch (Exception $e) {
         throw new Exception('Connection fail. Get challenge fail. ' . $e);
     }
     $data = array('username' => $config->username, 'auth_method' => $config->auth_method, 'auth_challenge' => $challenge['challenge'], 'auth_response' => md5($challenge['challenge'] . md5($config->password)), 'ver' => $config->protocol_version, 'lineendings' => $config->lineendings, 'subject' => $message['title'], 'event' => $message['text'], 'day' => date('d'), 'mon' => date('m'), 'year' => date('Y'), 'hour' => date('H'), 'min' => date('i'), 'security' => 'public', 'props' => array('opt_preformatted' => true, 'opt_backdated' => true, 'taglist' => $message['tags']), 'usejournal' => $config->community);
     //отправляем данные на сервер
     try {
         $p_data = $proxy->postevent($data);
     } catch (Exception $e) {
         throw new Exception('Post failed. ' . $e);
     }
     /*
     если все нормально, то сервер вернет структуру с 3-мя переменными:
     itemid - идентификатор поста
     url - URL-адрес поста
     anum - аутентификационный номер, созданный для этой записи
     */
     if (empty($p_data)) {
         echo 'Livejournal connection failed.';
         return $p_data;
     } else {
         return $p_data;
     }
 }
开发者ID:nurikk,项目名称:EvilRocketFramework,代码行数:38,代码来源:LiveJournal.php

示例8: __construct

 /**
  * @param Zend_XmlRpc_Client $client
  */
 public function __construct(Zend_XmlRpc_Client $client)
 {
     $this->_system = $client->getProxy('system');
 }
开发者ID:andrelsguerra,项目名称:pequiambiental,代码行数:7,代码来源:ServerIntrospection.php

示例9: getProxy

 public function getProxy($namespace = '')
 {
     if (empty($this->_proxyCache[$namespace])) {
         $this->_proxyCache[$namespace] = new Python_SimpleXMLRPCServerWithUnsupportedIntrospection($this, $namespace);
     }
     return parent::getProxy($namespace);
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:7,代码来源:ClientTest.php

示例10: xmlrpcConsoleAction

 public function xmlrpcConsoleAction()
 {
     $client = new Zend_XmlRpc_Client(MAIN_URL . '/example/service/rpc-server');
     $member = $client->getProxy('member');
 }
开发者ID:rlecellier,项目名称:basezf,代码行数:5,代码来源:ServiceController.php

示例11:

<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_XmlRpc
 * @subpackage Demos
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
/**
 * @see Zend_XmlRpc_Client
 */
require_once 'Zend/XmlRpc/Client.php';
$server = new Zend_XmlRpc_Client('http://www.upcdatabase.com/rpc');
$client = $server->getProxy();
print_r($client->lookupUPC('071641301627'));
开发者ID:MichaelGogeshvili,项目名称:sitewatch,代码行数:28,代码来源:xmlrpc-upc-lookup.php

示例12: __construct

 /**
  * @param Zend_XmlRpc_Client $client 
  */
 public function __construct($client)
 {
     $this->_system = $client->getProxy('system');
 }
开发者ID:BackupTheBerlios,项目名称:openpublisher-svn,代码行数:7,代码来源:ServerIntrospection.php

示例13: ping

 /**
  * Pingback from Wikidot page (source URI) to external page (target URI)
  *
  * @throws PingBackException if pinging is not successfull
  * @throws PingBackNotAvailableException when the target is not PingBack enabled
  * @return string the endpoint return value
  */
 public function ping()
 {
     try {
         $rpc = new Zend_XmlRpc_Client($this->getExternalPingBackURI());
         $srv = $rpc->getProxy('pingback');
         return $srv->ping($this->wikidotURI, $this->externalURI);
     } catch (Zend_Http_Client_Adapter_Exception $e) {
         throw new PingBackException("HTTP Error: " . $e->getMessage());
     } catch (Zend_Http_Client_Exception $e) {
         throw new PingBackException("HTTP Error: " . $e->getMessage());
     } catch (Zend_XmlRpc_Client_FaultException $e) {
         throw new PingBackException("XMLRCP Error: " . $e->getMessage(), $e->getCode());
     } catch (PingBackException $e) {
         throw new PingBackException("Pingback Error: " . $e->getMessage());
     } catch (Exception $e) {
         throw new PingBackException("Unknown Error: " . $e->getMessage());
     }
 }
开发者ID:jbzdak,项目名称:wikidot,代码行数:25,代码来源:PingBack.php

示例14: messageInput

 /**
  * Обработать сообщение и выдать результат анализа.
  * 
  * @param ISF_Message $message сообщение
  * @param string $domain поддомен, относительно которого обрабатывать сообщение
  * @return string результат анализа
  */
 public function messageInput(ISF_Message $message, $domain = null)
 {
     $params = array('partner' => $this->getPartnerAuth(), 'message' => $message->serialize());
     if ($domain !== null) {
         $params['domain'] = (string) $domain;
     }
     try {
         $result = $this->api_transport->getProxy()->sf->message->input($params);
         return $result['result'];
     } catch (Zend_XmlRpc_Client_FaultException $e) {
         throw new SF_API_Error($e->getMessage(), $e->getCode());
     }
 }
开发者ID:pombredanne,项目名称:spamfighter,代码行数:20,代码来源:SF_API.php

示例15:

<?php

$p = (double) $_POST['p'];
$i = $_POST['i'];
$n = (int) $_POST['n'];
$t = $_POST['t'];
$a = (int) $_POST['a'];
$i = (double) str_replace(',', '.', $i);
require 'startzend.php';
$client = new Zend_XmlRpc_Client('http://localhost/xmlgenerator/remote3.php');
$proxy = $client->getProxy('calculadora');
$m = $proxy->calculaMontante($p, $i, $n, $a);
$l = $m - $p;
//formatação
$l = str_replace('.', ',', $l);
$p = str_replace('.', ',', $p);
$i = str_replace('.', ',', $i * 100);
$m = str_replace('.', ',', $m);
$mensagem = "Um capital de R\$ {$p}, aplicado a uma taxa de juros de {$i}%, durante {$n} {$t} renderá R\$ {$l}";
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<?php 
echo $mensagem;
?>
开发者ID:pelif,项目名称:studyWS,代码行数:31,代码来源:local3.php


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