本文整理汇总了PHP中Zend_XmlRpc_Server::getFunctions方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Server::getFunctions方法的具体用法?PHP Zend_XmlRpc_Server::getFunctions怎么用?PHP Zend_XmlRpc_Server::getFunctions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_XmlRpc_Server
的用法示例。
在下文中一共展示了Zend_XmlRpc_Server::getFunctions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFunctions
/**
* get/loadFunctions() test
*/
public function testFunctions()
{
$expected = $this->_server->listMethods();
$functions = $this->_server->getFunctions();
$server = new Server();
$server->loadFunctions($functions);
$actual = $server->listMethods();
$this->assertSame($expected, $actual);
}
示例2: save
/**
* Cache a file containing the dispatch list.
*
* Serializes the XMLRPC server callbacks array and stores the information
* in Zend_Cache_Core
*
* @param string $id
* @param Zend_Cache_Core $coreCache
* @param Zend_XmlRpc_Server $server
* @return bool
*/
public static function save($id, Zend_Cache_Core $coreCache, Zend_XmlRpc_Server $server)
{
// Get function list
$methods = $server->getFunctions();
// Remove system.* methods
foreach ($methods as $name => $method) {
if ($method->system) {
unset($methods[$name]);
}
}
// Store
return (bool) $coreCache->save(serialize($methods), $id, array(), null);
}
示例3: testFunctions
/**
* get/loadFunctions() test
*/
public function testFunctions()
{
try {
$this->_server->addFunction(array('Zend_XmlRpc_Server_testFunction', 'Zend_XmlRpc_Server_testFunction2'), 'zsr');
} catch (Zend_XmlRpc_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);
}
示例4: save
/**
* Cache a file containing the dispatch list.
*
* Serializes the XMLRPC server callbacks array and stores the information
* in $filename.
*
* Returns false on any error (typically, inability to write to file), true
* on success.
*
* @param string $filename
* @param Zend_XmlRpc_Server $server
* @return bool
*/
public static function save($filename, Zend_XmlRpc_Server $server)
{
if (!is_string($filename) || !file_exists($filename) && !is_writable(dirname($filename))) {
return false;
}
// Remove system.* methods
$methods = $server->getFunctions();
foreach ($methods as $name => $method) {
if ($method->system) {
unset($methods[$name]);
}
}
// Store
if (0 === @file_put_contents($filename, serialize($methods))) {
return false;
}
return true;
}