44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
/*
|
|
IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002
|
|
Version 1.61 - Simon Willison, 11th July 2003 (htmlentities -> htmlspecialchars)
|
|
Site: http://scripts.incutio.com/xmlrpc/
|
|
Manual: http://scripts.incutio.com/xmlrpc/manual.php
|
|
Made available under the Artistic License: http://www.opensource.org/licenses/artistic-license.php
|
|
*/
|
|
|
|
/**
|
|
* IXR请求体
|
|
*
|
|
* @package IXR
|
|
*/
|
|
class IXR_Request {
|
|
var $method;
|
|
var $args;
|
|
var $xml;
|
|
function IXR_Request($method, $args) {
|
|
$this->method = $method;
|
|
$this->args = $args;
|
|
$this->xml = <<<EOD
|
|
<?xml version="1.0"?>
|
|
<methodCall>
|
|
<methodName>{$this->method}</methodName>
|
|
<params>
|
|
|
|
EOD;
|
|
foreach ($this->args as $arg) {
|
|
$this->xml .= '<param><value>';
|
|
$v = new IXR_Value($arg);
|
|
$this->xml .= $v->getXml();
|
|
$this->xml .= "</value></param>\n";
|
|
}
|
|
$this->xml .= '</params></methodCall>';
|
|
}
|
|
function getLength() {
|
|
return strlen($this->xml);
|
|
}
|
|
function getXml() {
|
|
return $this->xml;
|
|
}
|
|
}
|