Permalink
Browse files

Fixes #3341 removed xml-rpc code from Elgg - see xml-rpc plugin if yo…

…u need an xml-rpc endpoint
  • Loading branch information...
1 parent f84e36f commit dfaa80f0a44afe6faed0212e61c3edef48afc64d @cash cash committed Dec 15, 2011
@@ -421,8 +421,6 @@ public function isPublicPage($url = '') {
'action/security/refreshtoken',
'ajax/view/js/languages',
'upgrade\.php',
- 'xml-rpc\.php',
- 'mt/mt-xmlrpc\.cgi',
'css/.*',
'js/.*'
);
@@ -1,56 +0,0 @@
-<?php
-
-/**
- * An array containing other XMLRPCParameter objects.
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- *
- */
-class XMLRPCArrayParameter extends XMLRPCParameter
-{
- /**
- * Construct an array.
- *
- * @param array $parameters Optional array of parameters, if not provided
- * then addField must be used.
- */
- function __construct($parameters = NULL) {
- parent::__construct();
-
- if (is_array($parameters)) {
- foreach ($parameters as $v) {
- $this->addField($v);
- }
- }
- }
-
- /**
- * Add a field to the container.
- *
- * @param XMLRPCParameter $value The value.
- *
- * @return void
- */
- public function addField(XMLRPCParameter $value) {
- if (!is_array($this->value)) {
- $this->value = array();
- }
-
- $this->value[] = $value;
- }
-
- /**
- * Converts XML array to string
- *
- * @return string
- */
- function __toString() {
- $params = "";
- foreach ($this->value as $value) {
- $params .= "$value";
- }
-
- return "<array><data>$params</data></array>";
- }
-}
@@ -1,28 +0,0 @@
-<?php
-/**
- * A base 64 encoded blob of binary.
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-class XMLRPCBase64Parameter extends XMLRPCParameter {
- /**
- * Construct a base64 encoded block
- *
- * @param string $blob Unencoded binary blob
- */
- function __construct($blob) {
- parent::__construct();
-
- $this->value = base64_encode($blob);
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- function __toString() {
- return "<value><base64>{$value}</base64></value>";
- }
-}
@@ -1,30 +0,0 @@
-<?php
-/**
- * A boolean.
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-class XMLRPCBoolParameter extends XMLRPCParameter {
-
- /**
- * New bool parameter
- *
- * @param bool $value Value
- */
- function __construct($value) {
- parent::__construct();
-
- $this->value = (bool)$value;
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- function __toString() {
- $code = ($this->value) ? "1" : "0";
- return "<value><boolean>{$code}</boolean></value>";
- }
-}
@@ -1,62 +0,0 @@
-<?php
-/**
- * An XMLRPC call
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-class XMLRPCCall {
- /** Method name */
- private $methodname;
-
- /** Parameters */
- private $params;
-
- /**
- * Construct a new XML RPC Call
- *
- * @param string $xml XML
- */
- function __construct($xml) {
- $this->_parse($xml);
- }
-
- /**
- * Return the method name associated with the call.
- *
- * @return string
- */
- public function getMethodName() { return $this->methodname; }
-
- /**
- * Return the parameters.
- * Returns a nested array of XmlElement.
- *
- * @see XmlElement
- * @return array
- */
- public function getParameters() { return $this->params; }
-
- /**
- * Parse the xml into its components according to spec.
- * This first version is a little primitive.
- *
- * @param string $xml XML
- *
- * @return void
- */
- private function _parse($xml) {
- $xml = xml_to_object($xml);
-
- // sanity check
- if ((isset($xml->name)) && (strcasecmp($xml->name, "methodCall") != 0)) {
- throw new CallException(elgg_echo('CallException:NotRPCCall'));
- }
-
- // method name
- $this->methodname = $xml->children[0]->content;
-
- // parameters
- $this->params = $xml->children[1]->children;
- }
-}
@@ -1,33 +0,0 @@
-<?php
-/**
- * An ISO8601 data and time.
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-class XMLRPCDateParameter extends XMLRPCParameter {
- /**
- * Construct a date
- *
- * @param int $timestamp The unix timestamp, or blank for "now".
- */
- function __construct($timestamp = 0) {
- parent::__construct();
-
- $this->value = $timestamp;
-
- if (!$timestamp) {
- $this->value = time();
- }
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- function __toString() {
- $value = date('c', $this->value);
- return "<value><dateTime.iso8601>{$value}</dateTime.iso8601></value>";
- }
-}
@@ -1,29 +0,0 @@
-<?php
-/**
- * A double precision signed floating point number.
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-class XMLRPCDoubleParameter extends XMLRPCParameter {
-
- /**
- * New XML Double
- *
- * @param int $value Value
- */
- function __construct($value) {
- parent::__construct();
-
- $this->value = (float)$value;
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- function __toString() {
- return "<value><double>{$this->value}</double></value>";
- }
-}
@@ -1,36 +0,0 @@
-<?php
-
-/**
- * XMLRPC Error Response
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-class XMLRPCErrorResponse extends XMLRPCResponse {
- /**
- * Set the error response and error code.
- *
- * @param string $message The message
- * @param int $code Error code (default = system error as defined by
- * http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php)
- */
- function __construct($message, $code = -32400) {
- $this->addParameter(
- new XMLRPCStructParameter(
- array (
- 'faultCode' => new XMLRPCIntParameter($code),
- 'faultString' => new XMLRPCStringParameter($message)
- )
- )
- );
- }
-
- /**
- * Output to XML.
- *
- * @return string
- */
- public function __toString() {
- return "<methodResponse><fault><value>{$this->parameters[0]}</value></fault></methodResponse>";
- }
-}
@@ -1,29 +0,0 @@
-<?php
-/**
- * An Integer.
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-class XMLRPCIntParameter extends XMLRPCParameter {
-
- /**
- * A new XML int
- *
- * @param int $value Value
- */
- function __construct($value) {
- parent::__construct();
-
- $this->value = (int)$value;
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- function __toString() {
- return "<value><i4>{$this->value}</i4></value>";
- }
-}
@@ -1,16 +0,0 @@
-<?php
-/**
- * Superclass for all RPC parameters.
- *
- * @package Elgg.Core
- * @subpackage XMLRPC
- */
-abstract class XMLRPCParameter {
- protected $value;
-
- /**
- * Set initial values
- */
- function __construct() { }
-
-}
Oops, something went wrong.

0 comments on commit dfaa80f

Please sign in to comment.