当前位置: 首页>>代码示例>>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;未经允许,请勿转载。