mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
XML-RPC: break up class-IXR.php into individual class files.
See #37827. git-svn-id: https://develop.svn.wordpress.org/trunk@38389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
54
src/wp-includes/IXR/class-IXR-request.php
Normal file
54
src/wp-includes/IXR/class-IXR-request.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user