summaryrefslogtreecommitdiffstats
path: root/wp-includes/IXR/class-IXR-request.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/IXR/class-IXR-request.php')
-rw-r--r--wp-includes/IXR/class-IXR-request.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/wp-includes/IXR/class-IXR-request.php b/wp-includes/IXR/class-IXR-request.php
new file mode 100644
index 0000000..b00687b
--- /dev/null
+++ b/wp-includes/IXR/class-IXR-request.php
@@ -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;
+ }
+}