Class RestNarutoUtils

Description

This class defines the tools used by the REST client and server implementations.

Located in /classes/restNarutoUtils.php (line 16)


	
			
Method Summary
static string buildQueryString (array $args)
static string generateSalt (string $path, array $args)
static string recode (string $buffer, string $salt, boolean $encode)
static void sxeAck (SimpleXMLElement $sxe)
static void sxeAddAttributes (SimpleXMLElement $sxe, array $map)
static void sxeAddException (SimpleXMLElement $sxe, NarutoException $obj, string $seq)
static void sxeAddForum (SimpleXMLElement $sxe, NarutoForum $obj)
static void sxeAddForums (SimpleXMLElement $sxe, array $objs)
static void sxeAddTopic (SimpleXMLElement $sxe, NarutoTopic $obj)
static void sxeAddTopics (SimpleXMLElement $sxe, array $objs)
static void sxeAddUser (SimpleXMLElement $sxe, NarutoTopic $obj)
static void sxeDecimal (SimpleXMLElement $sxe, int $val)
static array sxeExtractAttributes (SimpleXMLElement $sxe)
static NarutoException sxeExtractException (SimpleXMLElement $sxe)
static NarutoForum sxeExtractForum (SimpleXMLElement $sxe)
static array sxeExtractForums (SimpleXMLElement $sxe)
static NarutoTopic sxeExtractTopic (SimpleXMLElement $sxe)
static array sxeExtractTopics (SimpleXMLElement $sxe)
static NarutoTopic sxeExtractUser (SimpleXMLElement $sxe)
static SimpleXMLElement sxeGetResponse (SimpleXMLElement $sxe, string $method, string $seq)
static SimpleXMLElement sxeGetRoot ()
static void sxeId (SimpleXMLElement $sxe, string $val)
static void sxeNak (SimpleXMLElement $sxe)
Methods
static buildQueryString (line 416)

Builds a query string from an map of parameters.

  • return: a query string.
  • access: public
static string buildQueryString (array $args)
  • array $args: the list of query parameters.
static generateSalt (line 27)

This method generates a request-unique sting by combining the path_info and request paramters.

  • return: a combination of the provided parameters.
static string generateSalt (string $path, array $args)
  • string $path: the method name.
  • array $args: the map of query arguments.
static recode (line 389)

Encodes and decodes special content sent over the network.

  • return: a binary string representing the content.
  • access: public
static string recode (string $buffer, string $salt, boolean $encode)
  • string $buffer: the content to be processed.
  • string $salt: the string used to scramble the content.
  • boolean $encode: true if encode, false if decoding.
static sxeAck (line 344)

Adds the ack element to a SimpleXMLElement.

static void sxeAck (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the parent element.
static sxeAddAttributes (line 311)

Adds the attributes element to a SimpleXMLElement.

static void sxeAddAttributes (SimpleXMLElement $sxe, array $map)
  • SimpleXMLElement $sxe: the parent element.
  • array $map: map of attributes.
static sxeAddException (line 269)

Adds the exception element to a SimpleXMLElement.

static void sxeAddException (SimpleXMLElement $sxe, NarutoException $obj, string $seq)
  • SimpleXMLElement $sxe: the root element.
  • NarutoException $obj: the exception.
  • string $seq: the sequence number.
static sxeAddForum (line 182)

Adds the forum element to a SimpleXMLElement.

static void sxeAddForum (SimpleXMLElement $sxe, NarutoForum $obj)
  • SimpleXMLElement $sxe: the parent element.
  • NarutoForum $obj: the forum.
static sxeAddForums (line 241)

Adds the forums element to a SimpleXMLElement.

static void sxeAddForums (SimpleXMLElement $sxe, array $objs)
  • SimpleXMLElement $sxe: the parent element.
  • array $objs: list of NarutoForum objects.
static sxeAddTopic (line 71)

Adds the topic element to a SimpleXMLElement.

static void sxeAddTopic (SimpleXMLElement $sxe, NarutoTopic $obj)
  • SimpleXMLElement $sxe: the parent element.
  • NarutoTopic $obj: the topic.
static sxeAddTopics (line 155)

Adds the topics element to a SimpleXMLElement.

static void sxeAddTopics (SimpleXMLElement $sxe, array $objs)
  • SimpleXMLElement $sxe: the parent element.
  • array $objs: list of NarutoTopic objects.
static sxeAddUser (line 116)

Adds the user element to a SimpleXMLElement.

static void sxeAddUser (SimpleXMLElement $sxe, NarutoTopic $obj)
  • SimpleXMLElement $sxe: the parent element.
  • NarutoTopic $obj: the topic.
static sxeDecimal (line 376)

Adds the Decimal element to a SimpleXMLElement.

static void sxeDecimal (SimpleXMLElement $sxe, int $val)
  • SimpleXMLElement $sxe: the parent element.
  • int $val: the decimal value
static sxeExtractAttributes (line 329)

Converts a SimpleXMLElement to a map of Attributes.

  • return: the map of attributes.
static array sxeExtractAttributes (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the Attributes element.
static sxeExtractException (line 291)

Converts a SimpleXMLElement to a map of Attributes.

  • return: the exception object.
static NarutoException sxeExtractException (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the Exception element.
static sxeExtractForum (line 206)

Converts a SimpleXMLElement to a NarutoForum object.

  • return: the NarutoForum object.
static NarutoForum sxeExtractForum (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the Forum element.
static sxeExtractForums (line 254)

Converts a SimpleXMLElement to a list of NarutoForum's.

  • return: a list of NarutoForum objects.
static array sxeExtractForums (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the Forums element.
static sxeExtractTopic (line 92)

Converts a SimpleXMLElement to a NarutoTopic object.

  • return: the NarutoTopic object.
static NarutoTopic sxeExtractTopic (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the Topic element.
static sxeExtractTopics (line 168)

Converts a SimpleXMLElement to a list of NarutoTopic's.

  • return: a list of NarutoTopic objects.
static array sxeExtractTopics (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the Topics element.
static sxeExtractUser (line 134)

Converts a SimpleXMLElement to a NarutoUser object.

  • return: the NarutoTopic object.
static NarutoTopic sxeExtractUser (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the Topic element.
static sxeGetResponse (line 55)

Adds the main response element to a SimpleXMLElement. The response element includes the version and seq attributes and is named $method + 'Response'.

  • return: the response element.
static SimpleXMLElement sxeGetResponse (SimpleXMLElement $sxe, string $method, string $seq)
  • SimpleXMLElement $sxe: the root element.
  • string $method: the method name.
  • string $seq: the sequence number.
static sxeGetRoot (line 40)

Returns the root element for the XML response.

  • return: the root element for the XML response.
static SimpleXMLElement sxeGetRoot ()
static sxeId (line 365)

Adds the Id element to a SimpleXMLElement.

static void sxeId (SimpleXMLElement $sxe, string $val)
  • SimpleXMLElement $sxe: the parent element.
  • string $val: the Id value
static sxeNak (line 354)

Adds the nak element to a SimpleXMLElement.

static void sxeNak (SimpleXMLElement $sxe)
  • SimpleXMLElement $sxe: the parent element.

Documentation generated on Sun, 26 Oct 2008 16:41:24 -0400 by phpDocumentor 1.4.2