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

File: RPC.php

Source Location: /XML_RPC-1.2.0RC7/RPC.php

Page Details:

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.

PHP versions 4 and 5

LICENSE: License is granted to use or modify this software ("XML-RPC for PHP") for commercial or non-commercial use provided the copyright of the author is preserved in any distributed or derivative work.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


string $GLOBALS['XML_RPC_Array'] [line 105]

Data types
Default value:   'array'


[ Top ]



string $GLOBALS['XML_RPC_backslash'] [line 179]

Compose backslashes for escaping regexp
Default value:   chr(92) . chr(92)


[ Top ]



string $GLOBALS['XML_RPC_Base64'] [line 99]

Data types
Default value:   'base64'


[ Top ]



string $GLOBALS['XML_RPC_Boolean'] [line 75]

Data types
Default value:   'boolean'


[ Top ]



string $GLOBALS['XML_RPC_DateTime'] [line 93]

Data types
Default value:   'dateTime.iso8601'


[ Top ]



string $GLOBALS['XML_RPC_defencoding'] [line 160]

Default XML encoding (ISO-8859-1, UTF-8 or US-ASCII)
Default value:   'UTF-8'


[ Top ]



string $GLOBALS['XML_RPC_Double'] [line 81]

Data types
Default value:   'double'


[ Top ]



array $GLOBALS['XML_RPC_err'] [line 135]

Error message numbers
Default value:   array(
    'unknown_method'      => 1,
    'invalid_return'      => 2,
    'incorrect_params'    => 3,
    'introspect_unknown'  => 4,
    'http_error'          => 5,
)


[ Top ]



int $GLOBALS['XML_RPC_erruser'] [line 166]

User error codes start at 800
Default value:   800


[ Top ]



int $GLOBALS['XML_RPC_errxml'] [line 172]

XML parse error codes start at 100
Default value:   100


[ Top ]



string $GLOBALS['XML_RPC_I4'] [line 63]

Data types
Default value:   'i4'


[ Top ]



string $GLOBALS['XML_RPC_Int'] [line 69]

Data types
Default value:   'int'


[ Top ]



array $GLOBALS['XML_RPC_str'] [line 147]

Error message strings
Default value:   array(
    'unknown_method'      => 'Unknown method',
    'invalid_return'      => 'Invalid return payload: enable debugging to examine incoming payload',
    'incorrect_params'    => 'Incorrect parameters passed to method',
    'introspect_unknown'  => 'Can\'t introspect: method unknown',
    'http_error'          => 'Didn\'t receive 200 OK from remote server.',
)


[ Top ]



string $GLOBALS['XML_RPC_String'] [line 87]

Data types
Default value:   'string'


[ Top ]



string $GLOBALS['XML_RPC_Struct'] [line 111]

Data types
Default value:   'struct'


[ Top ]



array $GLOBALS['XML_RPC_Types'] [line 118]

Data type meta-types
Default value:   array(
    $GLOBALS['XML_RPC_I4']       => 1,
    $GLOBALS['XML_RPC_Int']      => 1,
    $GLOBALS['XML_RPC_Boolean']  => 1,
    $GLOBALS['XML_RPC_String']   => 1,
    $GLOBALS['XML_RPC_Double']   => 1,
    $GLOBALS['XML_RPC_DateTime'] => 1,
    $GLOBALS['XML_RPC_Base64']   => 1,
    $GLOBALS['XML_RPC_Array']    => 2,
    $GLOBALS['XML_RPC_Struct']   => 3,
)


[ Top ]



array $GLOBALS['XML_RPC_xh'] [line 198]

Stores state during parsing

quick explanation of components:

  • st = builds up a string for evaluation
  • ac = accumulates values
  • qt = decides if quotes are needed for evaluation
  • cm = denotes struct or array (comma needed)
  • isf = indicates a fault
  • lv = indicates "looking for a value": implements the logic to allow values with no types to be strings
  • params = stores parameters in method calls
  • method = stores method name

Default value:   array()


[ Top ]



XML_RPC_ERROR_ALREADY_INITIALIZED [line 55]

XML_RPC_ERROR_ALREADY_INITIALIZED = 104
Error constants

[ Top ]



XML_RPC_ERROR_CONNECTION_FAILED [line 54]

XML_RPC_ERROR_CONNECTION_FAILED = 103
Error constants

[ Top ]



XML_RPC_ERROR_INVALID_TYPE [line 52]

XML_RPC_ERROR_INVALID_TYPE = 101
Error constants

[ Top ]



XML_RPC_ERROR_NON_NUMERIC_FOUND [line 53]

XML_RPC_ERROR_NON_NUMERIC_FOUND = 102
Error constants

[ Top ]



XML_RPC_cd [line 412]

void XML_RPC_cd( mixed $parser, mixed $data)

Character data handler for the XML parser


[ Top ]



XML_RPC_decode [line 1643]

mixed XML_RPC_decode( mixed $XML_RPC_val)

Takes a message in PHP XML_RPC object format and translates it into native PHP types


[ Top ]



XML_RPC_ee [line 285]

void XML_RPC_ee( mixed $parser, mixed $name)

End element handler for the XML parser


[ Top ]



XML_RPC_encode [line 1677]

string XML_RPC_encode( mixed $php_val)

Takes native php types and encodes them into XML_RPC PHP object format

Feature creep -- could support more types via optional type argument.



[ Top ]



XML_RPC_iso8601_decode [line 1623]

int XML_RPC_iso8601_decode( mixed $idate, [mixed $utc = 0])

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: the unix timestamp of the date submitted


[ Top ]



XML_RPC_iso8601_encode [line 1595]

string XML_RPC_iso8601_encode( mixed $timet, [mixed $utc = 0])

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: the formatted date


[ Top ]



XML_RPC_se [line 206]

void XML_RPC_se( mixed $parser, mixed $name, mixed $attrs)

Start element handler for the XML parser


[ Top ]



Documentation generated on Tue, 22 Feb 2005 01:20:08 -0500 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.