[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/bundled-libs/XML/ -> RPC.php (sommaire)

PHP implementation of the XML-RPC protocol This is a PEAR-ified version of Useful inc's XML-RPC for PHP. It has support for HTTP transport, proxies and authentication.

Author: Edd Dumbill <edd@usefulinc.com>
Author: Stig Bakken <stig@php.net>
Author: Martin Jansen <mj@php.net>
Author: Daniel Convissor <danielc@php.net>
Copyright: 1999-2001 Edd Dumbill, 2001-2005 The PHP Group
Version: CVS: $Id: RPC.php,v 1.83 2005/08/14 20:25:35 danielc Exp $
Poids: 1951 lignes (56 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 5 classes

XML_RPC_Base:: (2 méthodes):
  raiseError()
  isError()

XML_RPC_Client:: (6 méthodes):
  XML_RPC_Client()
  setDebug()
  setCredentials()
  send()
  sendPayloadHTTP10()
  createHeaders()

XML_RPC_Response:: (5 méthodes):
  XML_RPC_Response()
  faultCode()
  faultString()
  value()
  serialize()

XML_RPC_Message:: (13 méthodes):
  XML_RPC_Message()
  xml_header()
  xml_footer()
  createPayload()
  method()
  serialize()
  addParam()
  getParam()
  getNumParams()
  setSendEncoding()
  getEncoding()
  parseResponseFile()
  parseResponse()

XML_RPC_Value:: (22 méthodes):
  XML_RPC_Value()
  addScalar()
  addArray()
  addStruct()
  dump()
  kindOf()
  serializedata()
  serialize()
  serializeval()
  structmem()
  structreset()
  structeach()
  getval()
  scalarval()
  scalartyp()
  arraymem()
  arraysize()
  isValue()
  XML_RPC_iso8601_encode()
  XML_RPC_iso8601_decode()
  XML_RPC_decode()
  XML_RPC_encode()

Définit 22 fonctions

  XML_RPC_se()
  XML_RPC_ee()
  XML_RPC_cd()

Classe: XML_RPC_Base  - X-Ref

The common methods and properties for all of the XML_RPC classes

raiseError($msg, $code)   X-Ref
PEAR Error handling

return: object  PEAR_Error object

isError($value)   X-Ref
Tell whether something is a PEAR_Error object

param: mixed $value  the item to check
return: bool  whether $value is a PEAR_Error object or not

Classe: XML_RPC_Client  - X-Ref

The methods and properties for submitting XML RPC requests

XML_RPC_Client($path, $server, $port = 0,$proxy = '', $proxy_port = 0,$proxy_user = '', $proxy_pass = '')   X-Ref
Sets the object's properties

param: string  $path        the path and name of the RPC server script
param: string  $server      the URL of the remote server to connect to.
param: integer $port        a port for connecting to the remote server.
param: string  $proxy       the URL of the proxy server to use, if any.
param: integer $proxy_port  a port for connecting to the remote server.
param: string  $proxy_user  a user name for accessing the proxy server
param: string  $proxy_pass  a password for accessing the proxy server
return: void

setDebug($in)   X-Ref
Change the current debug mode

param: int $in  where 1 = on, 0 = off
return: void

setCredentials($u, $p)   X-Ref
Set username and password properties for connecting to the RPC server

param: string $u  the user name
param: string $p  the password
return: void

send($msg, $timeout = 0)   X-Ref
Transmit the RPC request via HTTP 1.0 protocol

param: object $msg       the XML_RPC_Message object
param: int    $timeout   how many seconds to wait for the request
return: object  an XML_RPC_Response object.  0 is returned if any

sendPayloadHTTP10($msg, $server, $port, $timeout = 0,$username = '', $password = '')   X-Ref
Transmit the RPC request via HTTP 1.0 protocol

Requests should be sent using XML_RPC_Client send() rather than
calling this method directly.

param: object $msg       the XML_RPC_Message object
param: string $server    the server to send the request to
param: int    $port      the server port send the request to
param: int    $timeout   how many seconds to wait for the request
param: string $username  a user name for accessing the RPC server
param: string $password  a password for accessing the RPC server
return: object  an XML_RPC_Response object.  0 is returned if any

createHeaders($msg)   X-Ref
Determines the HTTP headers and puts it in the $headers property

param: object $msg       the XML_RPC_Message object
return: boolean  TRUE if okay, FALSE if the message payload isn't set.

Classe: XML_RPC_Response  - X-Ref

The methods and properties for interpreting responses to XML RPC requests

XML_RPC_Response($val, $fcode = 0, $fstr = '')   X-Ref

return: void

faultCode()   X-Ref

return: int  the error code

faultString()   X-Ref

return: string  the error string

value()   X-Ref

return: mixed  the value

serialize()   X-Ref

return: string  the error message in XML format

Classe: XML_RPC_Message  - X-Ref

The methods and properties for composing XML RPC messages

XML_RPC_Message($meth, $pars = 0)   X-Ref

return: void

xml_header()   X-Ref
Produces the XML declaration including the encoding attribute

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

return: string  the XML declaration and <methodCall> element

xml_footer()   X-Ref

return: string  the closing </methodCall> tag

createPayload()   X-Ref

return: void

method($meth = '')   X-Ref

return: string  the name of the method

serialize()   X-Ref

return: string  the payload

addParam($par)   X-Ref

return: void

getParam($i)   X-Ref
Obtains an XML_RPC_Value object for the given parameter

param: int $i  the index number of the parameter to obtain
return: object  the XML_RPC_Value object.

getNumParams()   X-Ref

return: int  the number of parameters

setSendEncoding($type)   X-Ref
Sets the XML declaration's encoding attribute

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

getEncoding($data)   X-Ref
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.

param: string $data  the XML that will be parsed
return: string  the encoding to be used

parseResponseFile($fp)   X-Ref

return: object  a new XML_RPC_Response object

parseResponse($data = '')   X-Ref

return: object  a new XML_RPC_Response object

Classe: XML_RPC_Value  - X-Ref

The methods and properties that represent data in XML RPC format

XML_RPC_Value($val = -1, $type = '')   X-Ref

return: void

addScalar($val, $type = 'string')   X-Ref

return: int  returns 1 if successful or 0 if there are problems

addArray($vals)   X-Ref

return: int  returns 1 if successful or 0 if there are problems

addStruct($vals)   X-Ref

return: int  returns 1 if successful or 0 if there are problems

dump($ar)   X-Ref

return: void

kindOf()   X-Ref

return: string  the data type of the current value

serializedata($typ, $val)   X-Ref

return: string  the data in XML format

serialize()   X-Ref

return: string  the data in XML format

serializeval($o)   X-Ref

return: string  the data in XML format

structmem($m)   X-Ref

return: mixed  the contents of the element requested

structreset()   X-Ref

return: void

structeach()   X-Ref

return: the key/value pair of the struct's current element

getval()   X-Ref

return: mixed  the current value

scalarval()   X-Ref

return: mixed

scalartyp()   X-Ref

return: string

arraymem($m)   X-Ref

return: mixed  the struct's current element

arraysize()   X-Ref

return: int  the number of elements in the array

isValue($val)   X-Ref
Determines if the item submitted is an XML_RPC_Value object

param: mixed $val  the variable to be evaluated
return: bool  TRUE if the item is an XML_RPC_Value object

XML_RPC_iso8601_encode($timet, $utc = 0)   X-Ref
Return an ISO8601 encoded string

While timezones ought to be supported, the XML-RPC spec says:

"Don't assume a timezone. It should be specified by the server in its
documentation what assumptions it makes about timezones."

This routine always assumes localtime unless $utc is set to 1, in which
case UTC is assumed and an adjustment for locale is made when encoding.

return: string  the formatted date

XML_RPC_iso8601_decode($idate, $utc = 0)   X-Ref
Convert a datetime string into a Unix timestamp

While timezones ought to be supported, the XML-RPC spec says:

"Don't assume a timezone. It should be specified by the server in its
documentation what assumptions it makes about timezones."

This routine always assumes localtime unless $utc is set to 1, in which
case UTC is assumed and an adjustment for locale is made when encoding.

return: int  the unix timestamp of the date submitted

XML_RPC_decode($XML_RPC_val)   X-Ref
Converts an XML_RPC_Value object into native PHP types

param: object $XML_RPC_val  the XML_RPC_Value object to decode
return: mixed  the PHP values

XML_RPC_encode($php_val)   X-Ref
Converts native PHP types into an XML_RPC_Value object

param: mixed $php_val  the PHP value or variable you want encoded
return: object  the XML_RPC_Value object

Fonctions
Fonctions qui ne font pas partie d'une Classe:

XML_RPC_se($parser_resource, $name, $attrs)   X-Ref
Start element handler for the XML parser

return: void

XML_RPC_ee($parser_resource, $name)   X-Ref
End element handler for the XML parser

return: void

XML_RPC_cd($parser_resource, $data)   X-Ref
Character data handler for the XML parser

return: void



Généré le : Sat Nov 24 09:00:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics