2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00
Files
CATI_Tool/include/limesurvey/admin/classes/xmlrpc/doc/ch09.html
2011-11-14 04:27:30 +00:00

29 lines
7.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 9. Helper functions</title><link rel="stylesheet" href="xmlrpc.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="index.html" title="XML-RPC for PHP" /><link rel="up" href="index.html" title="XML-RPC for PHP" /><link rel="prev" href="ch08s02.html" title="Variables whose value can be modified" /><link rel="next" href="ch09s02.html" title="Easy use with nested PHP values" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Helper functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch08s02.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch09s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="helpers"></a>Chapter 9. Helper functions</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch09.html#id937598">Date functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch09.html#iso8601encode">iso8601_encode</a></span></dt><dt><span class="sect2"><a href="ch09.html#iso8601decode">iso8601_decode</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch09s02.html">Easy use with nested PHP values</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch09s02.html#phpxmlrpcdecode">php_xmlrpc_decode</a></span></dt><dt><span class="sect2"><a href="ch09s02.html#phpxmlrpcencode">php_xmlrpc_encode</a></span></dt><dt><span class="sect2"><a href="ch09s02.html#id938212">php_xmlrpc_decode_xml</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch09s03.html">Automatic conversion of php functions into xmlrpc methods (and
vice versa)</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch09s03.html#id938280">wrap_xmlrpc_method</a></span></dt><dt><span class="sect2"><a href="ch09s03.html#wrap_php_function">wrap_php_function</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch09s04.html">Functions removed from the library</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch09s04.html#xmlrpcdecode">xmlrpc_decode</a></span></dt><dt><span class="sect2"><a href="ch09s04.html#xmlrpcencode">xmlrpc_encode</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch09s05.html">Debugging aids</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch09s05.html#id938694">xmlrpc_debugmsg</a></span></dt></dl></dd></dl></div><p>XML-RPC for PHP contains some helper functions which you can use to
make processing of XML-RPC requests easier.</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id937598"></a>Date functions</h2></div></div></div><p>The XML-RPC specification has this to say on dates:</p><div class="blockquote"><blockquote class="blockquote"><p><a id="wrap_xmlrpc_method"></a>Don't assume a timezone. It should be
specified by the server in its documentation what assumptions it makes
about timezones.</p></blockquote></div><p>Unfortunately, this means that date processing isn't
straightforward. Although XML-RPC uses ISO 8601 format dates, it doesn't
use the timezone specifier.</p><p>We strongly recommend that in every case where you pass dates in
XML-RPC calls, you use UTC (GMT) as your timezone. Most computer
languages include routines for handling GMT times natively, and you
won't have to translate between timezones.</p><p>For more information about dates, see <a class="ulink" href="http://www.uic.edu/year2000/datefmt.html" target="_top">ISO 8601: The Right
Format for Dates</a>, which has a handy link to a PDF of the ISO
8601 specification. Note that XML-RPC uses exactly one of the available
representations: CCYYMMDDTHH:MM:SS.</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="iso8601encode"></a>iso8601_encode</h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">string<b class="fsfunc">iso8601_encode</b>(</code></td><td>string<var class="pdparam">$time_t</var>, </td></tr><tr><td> </td><td>int<var class="pdparam">$utc</var>0<code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Returns an ISO 8601 formatted date generated from the UNIX
timestamp <em class="parameter"><code>$time_t</code></em>, as returned by the PHP
function <code class="function">time()</code>.</p><p>The argument <em class="parameter"><code>$utc</code></em> can be omitted, in
which case it defaults to <code class="literal">0</code>. If it is set to
<code class="literal">1</code>, then the function corrects the time passed in
for UTC. Example: if you're in the GMT-6:00 timezone and set
<em class="parameter"><code>$utc</code></em>, you will receive a date representation
six hours ahead of your local time.</p><p>The included demo program <code class="filename">vardemo.php</code>
includes a demonstration of this function.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="iso8601decode"></a>iso8601_decode</h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">int<b class="fsfunc">iso8601_decode</b>(</code></td><td>string<var class="pdparam">$isoString</var>, </td></tr><tr><td> </td><td>int<var class="pdparam">$utc</var>0<code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Returns a UNIX timestamp from an ISO 8601 encoded time and date
string passed in. If <em class="parameter"><code>$utc</code></em> is
<code class="literal">1</code> then <em class="parameter"><code>$isoString</code></em> is assumed
to be in the UTC timezone, and thus the result is also UTC: otherwise,
the timezone is assumed to be your local timezone and you receive a
local timestamp.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch08s02.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch09s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Variables whose value can be modified </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Easy use with nested PHP values</td></tr></table></div></body></html>