mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-23 06:13:29 +02:00
See #37827. Built from https://develop.svn.wordpress.org/trunk@38389 git-svn-id: http://core.svn.wordpress.org/trunk@38330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
55 lines
927 B
PHP
55 lines
927 B
PHP
<?php
|
|
|
|
/**
|
|
* IXR_Request
|
|
*
|
|
* @package IXR
|
|
* @since 1.5.0
|
|
*/
|
|
class IXR_Request
|
|
{
|
|
var $method;
|
|
var $args;
|
|
var $xml;
|
|
|
|
/**
|
|
* PHP5 constructor.
|
|
*/
|
|
function __construct($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>';
|
|
}
|
|
|
|
/**
|
|
* PHP4 constructor.
|
|
*/
|
|
public function IXR_Request( $method, $args ) {
|
|
self::__construct( $method, $args );
|
|
}
|
|
|
|
function getLength()
|
|
{
|
|
return strlen($this->xml);
|
|
}
|
|
|
|
function getXml()
|
|
{
|
|
return $this->xml;
|
|
}
|
|
}
|