vrana Wed Jan 17 11:53:46 2007 UTC
Modified files: /phpdoc/en/reference/xmlrpc/functions xmlrpc-decode.xml xmlrpc-encode-request.xml xmlrpc-is-fault.xml Log: Document client side functions http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/xmlrpc/functions/xmlrpc-decode.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/xmlrpc/functions/xmlrpc-decode.xml diff -u phpdoc/en/reference/xmlrpc/functions/xmlrpc-decode.xml:1.3 phpdoc/en/reference/xmlrpc/functions/xmlrpc-decode.xml:1.4 --- phpdoc/en/reference/xmlrpc/functions/xmlrpc-decode.xml:1.3 Sun Jan 7 19:20:43 2007 +++ phpdoc/en/reference/xmlrpc/functions/xmlrpc-decode.xml Wed Jan 17 11:53:46 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.xmlrpc-decode"> <refnamediv> <refname>xmlrpc_decode</refname> @@ -13,8 +13,56 @@ <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> &warn.experimental.func; - &warn.undocumented.func; </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>xml</parameter></term> + <listitem> + <para> + XML response returned by XMLRPC method. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>encoding</parameter></term> + <listitem> + <para> + Input encoding supported by iconv (defaults to "iso-8859-1"). + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns an array made from response of XMLRPC method. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + See example by <function>xmlrpc_encode_request</function>. + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>xmlrpc_encode_request</function></member> + <member><function>xmlrpc_is_fault</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/xmlrpc/functions/xmlrpc-encode-request.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/xmlrpc/functions/xmlrpc-encode-request.xml diff -u phpdoc/en/reference/xmlrpc/functions/xmlrpc-encode-request.xml:1.4 phpdoc/en/reference/xmlrpc/functions/xmlrpc-encode-request.xml:1.5 --- phpdoc/en/reference/xmlrpc/functions/xmlrpc-encode-request.xml:1.4 Sun Jan 7 19:20:43 2007 +++ phpdoc/en/reference/xmlrpc/functions/xmlrpc-encode-request.xml Wed Jan 17 11:53:46 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.xmlrpc-encode-request"> <refnamediv> <refname>xmlrpc_encode_request</refname> @@ -14,8 +14,95 @@ <methodparam choice="opt"><type>array</type><parameter>output_options</parameter></methodparam> </methodsynopsis> &warn.experimental.func; - &warn.undocumented.func; </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>method</parameter></term> + <listitem> + <para> + Name of the method to call. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>params</parameter></term> + <listitem> + <para> + Method parameters compatible with method signature. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>output_options</parameter></term> + <listitem> + <para> + Array specifying output options may contain (default values are + emphasised): + <itemizedlist> + <listitem>output_type: php, <emphasis>xml</emphasis></listitem> + <listitem>verbosity: no_white_space, newlines_only, <emphasis>pretty</emphasis></listitem> + <listitem>escaping: cdata, <emphasis>non-ascii, non-print, markup</emphasis> + (may be a string with one value or an array with multiple values)</listitem> + <listitem>version: simple, <emphasis>xmlrpc</emphasis>, soap 1.1, auto</listitem> + <listitem>encoding: <emphasis>iso-8859-1</emphasis>, other character set supported by iconv</listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns a string containing the XML representation of the request. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>XMLRPC client functions example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$request = xmlrpc_encode_request("method", array(1, 2, 3)); +$context = stream_context_create(array('http' => array( + 'method' => "POST", + 'header' => "Content-Type: text/xml", + 'content' => $request +))); +$file = file_get_contents("http://www.example.com/xmlrpc", false, $context); +$response = xmlrpc_decode($file); +if (xmlrpc_is_fault($response)) { + trigger_error("xmlrpc: $response[faultString] ($response[faultCode])"); +} else { + print_r($response); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>stream_context_create</function></member> + <member><function>file_get_contents</function></member> + <member><function>xmlrpc_decode</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/xmlrpc/functions/xmlrpc-is-fault.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/xmlrpc/functions/xmlrpc-is-fault.xml diff -u phpdoc/en/reference/xmlrpc/functions/xmlrpc-is-fault.xml:1.4 phpdoc/en/reference/xmlrpc/functions/xmlrpc-is-fault.xml:1.5 --- phpdoc/en/reference/xmlrpc/functions/xmlrpc-is-fault.xml:1.4 Sun Jan 7 19:20:43 2007 +++ phpdoc/en/reference/xmlrpc/functions/xmlrpc-is-fault.xml Wed Jan 17 11:53:46 2007 @@ -1,11 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.xmlrpc-is-fault"> <refnamediv> <refname>xmlrpc_is_fault</refname> - <refpurpose> - Determines if an array value represents an XMLRPC fault - </refpurpose> + <refpurpose>Determines if an array value represents an XMLRPC fault</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -14,8 +12,49 @@ <methodparam><type>array</type><parameter>arg</parameter></methodparam> </methodsynopsis> &warn.experimental.func; - &warn.undocumented.func; </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>arg</parameter></term> + <listitem> + <para> + Array returned by <function>xmlrpc_decode</function>. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns &true; if the argument means fault, &false; otherwise. Fault + description is available in <literal>$arg["faultString"]</literal>, fault + code is in <literal>$arg["faultCode"]</literal>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + See example by <function>xmlrpc_encode_request</function>. + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>xmlrpc_decode</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file