mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document client side functions
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@227440 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
f10d059d0d
commit
1358713ab8
3 changed files with 183 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue