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

Class: XML_RPC_Message

Source Location: /modules/pearxmlrpc/rpc.php

Class Overview

XML_RPC_Base
   |
   --XML_RPC_Message

The methods and properties for composing XML RPC messages


Author(s):

Version:

  • Release: 1.5.1

Copyright:

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

Variables

Methods


Inherited Methods

Class: XML_RPC_Base

XML_RPC_Base::isError()
Tell whether something is a PEAR_Error object
XML_RPC_Base::raiseError()
PEAR Error handling

Class Details

[line 1166]
The methods and properties for composing XML RPC messages



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 1175]

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



Tags:

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

Type:   boolean


[ Top ]

$debug =  0

[line 1181]

The current debug mode (1 = on, 0 = off)


Type:   integer


[ Top ]

$methodname =  ''

[line 1198]

The method presently being evaluated


Type:   string


[ Top ]

$params = array()

[line 1203]


Type:   array


[ Top ]

$payload =  ''

[line 1209]

The XML message being generated


Type:   string


[ Top ]

$remove_extra_lines =  true

[line 1216]

Should extra line breaks be removed from the payload?



Tags:

since:  Property available since Release 1.4.6

Type:   boolean


[ Top ]

$response_payload =  ''

[line 1223]

The XML response from the remote server



Tags:

since:  Property available since Release 1.4.6

Type:   string


[ Top ]

$send_encoding =  ''

[line 1192]

The encoding to be used for outgoing messages

Defaults to the value of $GLOBALS['XML_RPC_defencoding']




Tags:


Type:   string


[ Top ]



Class Methods


constructor XML_RPC_Message [line 1229]

void XML_RPC_Message( $meth, [ $pars = 0])



Parameters:

   $meth  
   $pars  

[ Top ]

method addParam [line 1332]

void addParam( $par)



Parameters:

   $par  

[ Top ]

method createPayload [line 1288]

void createPayload( )

Fills the XML_RPC_Message::$payload property

Part of the process makes sure all line endings are in DOS format (CRLF), which is probably required by specifications.

If XML_RPC_Message::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:



[ Top ]

method getEncoding [line 1420]

string getEncoding( string $data)

Determine the XML's encoding via the encoding attribute in the XML declaration

If the encoding parameter is not set or is not ISO-8859-1, UTF-8 or US-ASCII, $XML_RPC_defencoding will be returned.




Tags:

return:  the encoding to be used
link:  http://php.net/xml_parser_create
since:  Method available since Release 1.2.0


Parameters:

string   $data   the XML that will be parsed

[ Top ]

method getNumParams [line 1364]

int getNumParams( )



Tags:

return:  the number of parameters


[ Top ]

method getParam [line 1347]

object the getParam( int $i)

Obtains an XML_RPC_Value object for the given parameter



Tags:

return:  XML_RPC_Value object. If the parameter doesn't exist, an XML_RPC_Response object.
since:  Returns XML_RPC_Response object on error since Release 1.3.0


Parameters:

int   $i   the index number of the parameter to obtain

[ Top ]

method method [line 1312]

string method( [ $meth = ''])



Tags:

return:  the name of the method


Parameters:

   $meth  

[ Top ]

method parseResponse [line 1463]

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



Tags:

return:  new XML_RPC_Response object


Parameters:

   $data  

[ Top ]

method parseResponseFile [line 1450]

object a parseResponseFile( $fp)



Tags:

return:  new XML_RPC_Response object


Parameters:

   $fp  

[ Top ]

method serialize [line 1323]

string serialize( )



Tags:

return:  the payload


[ Top ]

method setConvertPayloadEncoding [line 1382]

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::setSendEncoding()
since:  Method available since Release 1.5.1


Parameters:

int   $in   where 1 = on, 0 = off

[ Top ]

method setSendEncoding [line 1401]

void setSendEncoding( string $type)

Sets the XML declaration's encoding attribute



Tags:

see:  XML_RPC_Message::setConvertPayloadEncoding(), XML_RPC_Message::xml_header()
since:  Method available since Release 1.2.0


Parameters:

string   $type   the encoding type (ISO-8859-1, UTF-8 or US-ASCII)

[ Top ]

method xml_footer [line 1265]

string xml_footer( )



Tags:

return:  the closing </methodCall> tag


[ Top ]

method xml_header [line 1251]

string xml_header( )

Produces the XML declaration including the encoding attribute

The encoding is determined by this class' $send_encoding property. If the $send_encoding property is not set, use $GLOBALS['XML_RPC_defencoding'].




Tags:

return:  the XML declaration and <methodCall> element
see:  XML_RPC_Message::setSendEncoding(), XML_RPC_Message::$send_encoding, $GLOBALS['XML_RPC_defencoding']


[ Top ]


Documentation generated on Thu, 12 Feb 2009 08:00:07 +0900 by phpDocumentor 1.4.2