예제 #1
0
 /**
  * Adds a callback, extends parent method
  *
  * add another parameter to define if anonymous access to
  * this method should be granted.
  */
 function addCallback($method, $callback, $args, $help, $public = false)
 {
     if ($public) {
         $this->public_methods[] = $method;
     }
     return parent::addCallback($method, $callback, $args, $help);
 }
예제 #2
0
 public static function respond()
 {
     $server = new IXR_IntrospectionServer();
     foreach (PicoraXMLRPC::getMethods() as $name => $info) {
         $server->addCallback($name, create_function('$args', 'return call_user_func_array(array(\'' . $info[0][0] . '\',\'' . $info[0][1] . '\'),$args);'), $info[1], isset($info[2]) ? $info[2] : '');
     }
     $server->serve(file_get_contents("php://input"));
     exit;
 }
예제 #3
0
파일: rpc2.php 프로젝트: n0nick/n0where
 * @param  array  $args (in appkey string, in blogid string, in username string,
 *                       in password string, in template string,
 *                       in templateType string)
 * @return string Upon success this will return the bollean true value. Upon
 *                failure, the fault will be returned.
 * @link   http://docs.openlinksw.com/virtuoso/fn_blogger.setTemplate.html
 * @deprecated    I do not support Blogger-type templates.
 */
function setTemplate($args)
{
    global $server;
    $server->error(8001, 'Unsupported method.');
}
// setTemplate()
/* SERVER CODE */
// create server
$server = new IXR_IntrospectionServer();
global $server;
// Now add the callbacks along with their introspection details
$server->addCallback('blogger.newPost', 'newPost', array('string', 'string', 'string', 'string', 'string', 'string', 'boolean'), 'This function creates a new post and optionally publishes it.');
$server->addCallback('blogger.editPost', 'editPost', array('string', 'string', 'string', 'string', 'string', 'string', 'boolean'), 'This function edits an existing post and optionally publishes it.');
$server->addCallback('blogger.deletePost', 'deletePost', array('string', 'string', 'string', 'string', 'string', 'boolean'), 'This function deletes a post from the server.');
$server->addCallback('blogger.getRecentPosts', 'getRecentPosts', array('string', 'string', 'string', 'string', 'string', 'int'), 'This function retrieves a list of the most recent posts on the server.');
$server->addCallback('blogger.getPost', 'getPost', array('string', 'string', 'string', 'string', 'string'), 'This function retrieves an existing post from the server.');
$server->addCallback('blogger.getUsersBlogs', 'getUsersBlogs', array('struct', 'string', 'string', 'string'), 'This function retrieves a list of weblogs for which a user has posting ' . 'privileges.');
$server->addCallback('blogger.getUserInfo', 'getUserInfo', array('struct', 'string', 'string', 'string'), 'This function retrieves information about a blog author.');
$server->addCallback('blogger.getTemplate', 'getTemplate', array('string', 'string', 'string', 'string', 'string', 'string'), '(UNSUPPORTED) This function retrieves the content of the requested ' . 'template.');
$server->addCallback('blogger.setTemplate', 'setTemplate', array('string', 'string', 'string', 'string', 'string', 'string', 'string'), '(UNSUPPORTED) This function sets the content of the specfied template.');
// And serve the request
$server->serve();
/* Simba says Roar! */