XML_RPC
[ class tree: XML_RPC ] [ index: XML_RPC ] [ all elements ]

Class: XML_RPC_Server

Source Location: /pear/XML/RPC/Server.php

Class Overview


A server for receiving and replying to XML RPC requests


Author(s):

Version:

  • Release: 1.5.1

Copyright:

  • 1999-2001 Edd Dumbill, 2001-2006 The PHP Group

Variables

Methods



Class Details

[line 276]
A server for receiving and replying to XML RPC requests

  1.  $server new XML_RPC_Server(
  2.      array(
  3.          'isan8' =>
  4.              array(
  5.                  'function' => 'is_8',
  6.                  'signature' =>
  7.                       array(
  8.                           array('boolean''int'),
  9.                           array('boolean''int''boolean'),
  10.                           array('boolean''string'),
  11.                           array('boolean''string''boolean'),
  12.                       ),
  13.                  'docstring' => 'Is the value an 8?'
  14.              ),
  15.      ),
  16.      1,
  17.      0
  18.  );




Tags:

author:  Daniel Convissor <danielc@php.net>
author:  Stig Bakken <stig@php.net>
author:  Edd Dumbill <edd@usefulinc.com>
author:  Martin Jansen <mj@php.net>
version:  Release: 1.5.1
copyright:  1999-2001 Edd Dumbill, 2001-2006 The PHP Group
link:  http://pear.php.net/package/XML_RPC


[ Top ]


Class Variables

$convert_payload_encoding =  false

[line 285]

Should the payload's content be passed through mb_convert_encoding()?



Tags:

see:  XML_RPC_Server::setConvertPayloadEncoding()
since:  Property available since Release 1.5.1

Type:   boolean


[ Top ]

$debug =  0

[line 304]

Debug mode (0 = off, 1 = on)


Type:   integer


[ Top ]

$dmap = array()

[line 291]

The dispatch map, listing the methods this server provides.


Type:   array


[ Top ]

$encoding =  ''

[line 298]

The present response's encoding



Tags:


Type:   string


[ Top ]

$server_headers =  ''

[line 310]

The response's HTTP headers


Type:   string


[ Top ]

$server_payload =  ''

[line 316]

The response's XML payload


Type:   string


[ Top ]



Class Methods


constructor XML_RPC_Server [line 342]

void XML_RPC_Server( array $dispMap, [int $serviceNow = 1], [int $debug = 0])

Constructor for the XML_RPC_Server class



Parameters:

array   $dispMap   the dispatch map. An associative array explaining each function. The keys of the main array are the procedure names used by the clients. The value is another associative array that contains up to three elements:
  • The 'function' element's value is the name of the function or method that gets called. To define a class' method: 'class::method'.
  • The 'signature' element (optional) is an array describing the return values and parameters
  • The 'docstring' element (optional) is a string describing what the method does
int   $serviceNow   should the HTTP response be sent now? (1 = yes, 0 = no)
int   $debug   should debug output be displayed? (1 = yes, 0 = no)

[ Top ]

method createServerHeaders [line 482]

boolean createServerHeaders( )

Determines the HTTP headers and puts them in the $server_headers property



Tags:

return:  TRUE if okay, FALSE if $server_payload isn't set.
uses:  XML_RPC_Server::createServerPayload(), - XML_RPC_Server::$server_headers


[ Top ]

method createServerPayload [line 460]

void createServerPayload( )

Generates the payload and puts it in the $server_payload property

If XML_RPC_Server::setConvertPayloadEncoding() was set to true, the payload gets passed through mb_convert_encoding() to ensure the payload matches the encoding set in the XML declaration. The encoding type can be manually set via XML_RPC_Message::setSendEncoding().




Tags:

see:  XML_RPC_Server::setConvertPayloadEncoding()
uses:  XML_RPC_Server::parseRequest(), - XML_RPC_Server::$encoding, XML_RPC_Response::serialize(), XML_RPC_Server::serializeDebug()


[ Top ]

method echoInput [line 667]

void echoInput( )

Echos back the input packet as a string value



Tags:

return:  Useful for debugging.


[ Top ]

method parseRequest [line 551]

object a parseRequest( [ $data = ''])



Tags:

return:  new XML_RPC_Response object
uses:  XML_RPC_Message::getEncoding(), - XML_RPC_Server::$encoding


Parameters:

   $data  

[ Top ]

method serializeDebug [line 365]

string serializeDebug( )



Tags:

return:  the debug information if debug debug mode is on


[ Top ]

method service [line 417]

void service( )

Sends the response

The encoding and content-type are determined by XML_RPC_Message::getEncoding()




Tags:

uses:  XML_RPC_Server::createServerPayload(), - XML_RPC_Server::createServerHeaders()


[ Top ]

method setConvertPayloadEncoding [line 397]

void setConvertPayloadEncoding( int $in)

Sets whether the payload's content gets passed through mb_convert_encoding()

Returns PEAR_ERROR object if mb_convert_encoding() isn't available.




Tags:

see:  XML_RPC_Message::getEncoding()
since:  Method available since Release 1.5.1


Parameters:

int   $in   where 1 = on, 0 = off

[ Top ]

method verifySignature [line 497]

array verifySignature( $in, $sig)



Parameters:

   $in  
   $sig  

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:52:00 +0100 by phpDocumentor 1.4.3