本文整理匯總了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;
}