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


PHP Zend_XmlRpc_Server::loadFunctions方法代碼示例

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


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

示例1: testLoadFunctionsReadsMethodsFromServerDefinitionObjects

 public function testLoadFunctionsReadsMethodsFromServerDefinitionObjects()
 {
     $mockedMethod = $this->getMock('Zend_Server_Method_Definition', array(), array(), '', false, false);
     $mockedDefinition = $this->getMock('Zend_Server_Definition', array(), array(), '', false, false);
     $mockedDefinition->expects($this->once())->method('getMethods')->will($this->returnValue(array('bar' => $mockedMethod)));
     $this->_server->loadFunctions($mockedDefinition);
 }
開發者ID:crodriguezn,項目名稱:crossfit-milagro,代碼行數:7,代碼來源:ServerTest.php

示例2: testLoadFunctionsThrowsExceptionWithBadData

 public function testLoadFunctionsThrowsExceptionWithBadData()
 {
     $o = new stdClass();
     try {
         $this->_server->loadFunctions($o);
         $this->fail('loadFunctions() should not accept objects');
     } catch (Exception $e) {
         // success
     }
     $o = array($o);
     try {
         $this->_server->loadFunctions($o);
         $this->fail('loadFunctions() should not allow non-reflection objects in an array');
     } catch (Exception $e) {
         // success
     }
 }
開發者ID:jon9872,項目名稱:zend-framework,代碼行數:17,代碼來源:ServerTest.php

示例3: get

 /**
  * Add dispatch table from a file
  *
  * Unserializes a stored dispatch table from $filename. Returns false if it
  * fails in any way, true on success.
  *
  * Useful to prevent needing to build the dispatch list on each XMLRPC
  * request. Sample usage:
  *
  * <code>
  * if (!Zend_XmlRpc_Server_Cache::get($filename, $server)) {
  *     require_once 'Some/Service/Class.php';
  *     require_once 'Another/Service/Class.php';
  *
  *     // Attach Some_Service_Class with namespace 'some'
  *     $server->attach('Some_Service_Class', 'some');
  *
  *     // Attach Another_Service_Class with namespace 'another'
  *     $server->attach('Another_Service_Class', 'another');
  *
  *     Zend_XmlRpc_Server_Cache::save($filename, $server);
  * }
  *
  * $response = $server->handle();
  * echo $response;
  * </code>
  *
  * @param string $filename
  * @param Zend_XmlRpc_Server $server
  * @return bool
  */
 public static function get($filename, Zend_XmlRpc_Server $server)
 {
     if (!is_string($filename) || !file_exists($filename) || !is_readable($filename)) {
         return false;
     }
     if (false === ($dispatch = @file_get_contents($filename))) {
         return false;
     }
     if (false === ($dispatchArray = @unserialize($dispatch))) {
         return false;
     }
     $server->loadFunctions($dispatchArray);
     return true;
 }
開發者ID:villos,項目名稱:tree_admin,代碼行數:45,代碼來源:Cache.php

示例4: get

    /**
     * Add dispatch table from a file
     *
     * Unserializes a stored dispatch table. Returns false if it
     * fails in any way, true on success.
     *
     * Useful to prevent needing to build the dispatch list on each XMLRPC
     * request. Sample usage:
     *
     * <code>
     * if (!Zym_XmlRpc_Server_Cache::get($id, $coreCache, $server)) {
     *     require_once 'Some/Service/Class.php';
     *     require_once 'Another/Service/Class.php';
     *
     *     // Attach Some_Service_Class with namespace 'some'
     *     $server->setClass('Some_Service_Class', 'some');
     *
     *     // Attach Another_Service_Class with namespace 'another'
     *     $server->setClass('Another_Service_Class', 'another');
     *
     *     Zym_XmlRpc_Server_Cache::save($id, $coreCache, $server);
     * }
     *
     * $response = $server->handle();
     * echo $response;
     * </code>
     *
     * @param string             $id
     * @param Zend_Cache_Core    $coreCache
     * @param Zend_XmlRpc_Server $server
     *
     * @return boolean
     */
    public static function get($id, Zend_Cache_Core $coreCache, Zend_XmlRpc_Server $server)
    {
        $dispatchArray = @unserialize($coreCache->load($id, false, true));

        try {
            $server->loadFunctions($dispatchArray);
        } catch (Zend_XmlRpc_Server_Exception $e) {
            return false;
        }

        return true;
    }
開發者ID:BGCX262,項目名稱:zym-svn-to-git,代碼行數:45,代碼來源:Cache.php

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

示例6: get

 /**
  * Add dispatch table from a file
  *
  * Unserializes a stored dispatch table from $filename. Returns false if it
  * fails in any way, true on success.
  *
  * Useful to prevent needing to build the dispatch list on each XMLRPC
  * request. Sample usage:
  *
  * <code>
  * if (!Zend_XmlRpc_Server_Cache::get($id, $coreCache, $server)) {
  *     require_once 'Some/Service/Class.php';
  *     require_once 'Another/Service/Class.php';
  *
  *     // Attach Some_Service_Class with namespace 'some'
  *     $server->attach('Some_Service_Class', 'some');
  *
  *     // Attach Another_Service_Class with namespace 'another'
  *     $server->attach('Another_Service_Class', 'another');
  *
  *     Zend_XmlRpc_Server_Cache::save($id, $coreCache, $server);
  * }
  *
  * $response = $server->handle();
  * echo $response;
  * </code>
  *
  * @param string $filename
  * @param Zend_XmlRpc_Server $server
  */
 public static function get($id, Zend_Cache_Core $coreCache, Zend_XmlRpc_Server $server)
 {
     $dispatchArray = @unserialize($coreCache->load($id, false, true));
     $server->loadFunctions($dispatchArray);
 }
開發者ID:BGCX262,項目名稱:zym-svn-to-git,代碼行數:35,代碼來源:Cache.php


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