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


PHP Zend_XmlRpc_Server::addFunction方法代碼示例

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


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

示例1: testFunctions

 /**
  * get/loadFunctions() test
  */
 public function testFunctions()
 {
     try {
         $this->_server->addFunction(array('Zend_XmlRpc_Server_testFunction', 'Zend_XmlRpc_Server_testFunction2'), 'zsr');
     } catch (Exception $e) {
         $this->fail('Error attaching functions: ' . $e->getMessage());
     }
     $expected = $this->_server->listMethods();
     $functions = $this->_server->getFunctions();
     $server = new Zend_XmlRpc_Server();
     $server->loadFunctions($functions);
     $actual = $server->listMethods();
     $this->assertSame($expected, $actual);
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:17,代碼來源:ServerTest.php

示例2: testHandleFunction

 public function testHandleFunction()
 {
     $this->_server->addFunction('Zend_XmlRpc_Server_testFunction');
     $request = new Zend_XmlRpc_Request();
     $request->setMethod('Zend_XmlRpc_Server_testFunction');
     $request->setParams(array(array('value1'), 'key'));
     $response = $this->_server->handle($request);
     $this->assertEquals('key: value1', $response->getReturnValue());
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:9,代碼來源:ServerTest.php

示例3: testHandleFunction

 public function testHandleFunction()
 {
     $this->_server->addFunction('ZendTest\\XmlRpc\\testFunction');
     $request = new Request();
     $request->setMethod('ZendTest\\XmlRpc\\testFunction');
     $request->setParams(array(array('value1'), 'key'));
     $response = $this->_server->handle($request);
     $this->assertFalse($response instanceof Fault);
     $this->assertEquals('key: value1', $response->getReturnValue());
 }
開發者ID:rafalwrzeszcz,項目名稱:zf2,代碼行數:10,代碼來源:ServerTest.php

示例4: login

 * @return boolean true on success, else false.
 */
function login($username, $password)
{
    $h = new MailboxHandler();
    if ($h->login($username, $password)) {
        session_regenerate_id();
        $_SESSION['authenticated'] = true;
        $_SESSION['sessid'] = array();
        $_SESSION['sessid']['username'] = $username;
        return true;
    }
    return false;
}
if (!isset($_SESSION['authenticated'])) {
    $server->addFunction('login', 'login');
} else {
    $server->setClass('UserProxy', 'user');
    $server->setClass('VacationProxy', 'vacation');
    $server->setClass('AliasProxy', 'alias');
}
echo $server->handle();
class UserProxy
{
    /**
     * @param string $old_password
     * @param string $new_password
     * @return boolean true on success
     */
    public function changePassword($old_password, $new_password)
    {
開發者ID:mpietruschka,項目名稱:postfixadmin,代碼行數:31,代碼來源:xmlrpc.php

示例5: getPhpInfo

<?php

error_reporting(E_ALL & ~E_WARNING);
ini_set('display_errors', true);
require_once 'Zend/XmlRpc/Server.php';
$server = new Zend_XmlRpc_Server();
$server->addFunction('getPhpInfo');
echo $server->handle();
/**
 * @return string
 */
function getPhpInfo()
{
    return file_get_contents('./phpinfo.html');
}
開發者ID:Tony133,項目名稱:zf-web,代碼行數:15,代碼來源:service.php


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