document new functions

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@263338 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Stanislav Malyshev 2008-07-23 20:38:32 +00:00
parent 344a9ce520
commit 8515904ebe
2 changed files with 123 additions and 3 deletions

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="locale.acceptfromhttp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Locale::acceptFromHttp</refname>
<refname>locale_accept_from_http</refname>
<refpurpose>Tries to find out best available locale based on HTTP "Accept-Language" header</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>
Object oriented style
</para>
<methodsynopsis>
<modifier>static</modifier>
<type>string</type>
<methodname>Locale::acceptFromHttp</methodname>
<methodparam><type>string</type><parameter>header</parameter></methodparam>
</methodsynopsis>
<para>
Procedural style
</para>
<methodsynopsis>
<type>string</type>
<methodname>locale_accept_from_http</methodname>
<methodparam><type>string</type><parameter>header</parameter></methodparam>
</methodsynopsis>
<para>
Tries to find locale that can satisfy the language list that is requested by the
HTTP "Accept-Language" header.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>header</parameter></term>
<listitem>
<para>
The string containing the "Accept-Language" header according to format in RFC 2616.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The corresponding locale identifier.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>locale_accept_from_http</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$locale = locale_accept_from_http($_SERVER('HTTP_ACCEPT_LANGUAGE'));
echo $locale;
?>
]]>
</programlisting>
</example>
<example>
<title>OO example</title>
<programlisting role="php">
<![CDATA[
<?php
$locale = Locale::acceptFromHttp($_SERVER('HTTP_ACCEPT_LANGUAGE'));
echo $locale;
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
en_US
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>locale_lookup</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<refentry xml:id="locale.composelocale" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Locale::composeLocale</refname>
@ -23,7 +23,7 @@
</para>
<methodsynopsis>
<type>string</type>
<methodname>locale_compose_locale</methodname>
<methodname>locale_compose</methodname>
<methodparam><type>array</type><parameter>subtags</parameter></methodparam>
</methodsynopsis>
<para>
@ -77,7 +77,7 @@
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>locale_compose_locale</function> example</title>
<title><function>locale_compose</function> example</title>
<programlisting role="php">
<![CDATA[
<?php