add IDN docs, refactor a bit

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@284667 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Stanislav Malyshev 2009-07-23 22:21:32 +00:00
parent cad9eb9356
commit 8f77b0e189
17 changed files with 351 additions and 10 deletions

View file

@ -95,6 +95,9 @@
&reference.intl.messageformatter;
&reference.intl.dateformatter;
&reference.intl.grapheme;
&reference.intl.idn;
&reference.intl.reference;
</book>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<appendix xml:id="intl.constants" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
@ -17,6 +17,40 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_DEFAULT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Prohibit processing of unassigned codepoints in the input for IDN
functions and do not check if the input conforms to domain name ASCII rules.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_ALLOW_UNASSIGNED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow processing of unassigned codepoints in the input for IDN functions.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_USE_STD3_RULES</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Check if the input for IDN functions conforms to domain name ASCII rules.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</appendix>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 283819 $ -->
<reference xml:id="ref.intl.grapheme" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Grapheme &Functions;</title>
&reference.intl.entities.grapheme;
</reference>
<!-- 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$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-extract" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_extract</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-stripos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_stripos</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-stristr" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_stristr</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-strlen" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strlen</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-strpos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strpos</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-strripos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strripos</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-strrpos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strrpos</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-strstr" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strstr</refname>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.grapheme-substr" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_substr</refname>

27
reference/intl/idn.xml Normal file
View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 283819 $ -->
<reference xml:id="ref.intl.idn" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>IDN &Functions;</title>
&reference.intl.entities.idn;
</reference>
<!-- 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

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.idn-to-ascii" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>idn_to_ascii</refname>
<refpurpose>Convert domain name to IDNA ASCII form.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>Procedural style</para>
<methodsynopsis>
<type>string</type><methodname>idn_to_ascii</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam choice='opt'><type>int</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
This function converts Unicode domain name to IDNA ASCII-compatible format.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>domain</parameter></term>
<listitem>
<para>
Domain to convert. In PHP 5 must be UTF-8 encoded.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
Conversion options - combination of IDNA_* constants.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Domain name encoded in ASCII-compatible form.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>idn_to_ascii</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo idn_to_ascii('täst.de');
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
xn--tst-qla.de
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>idn_to_unicode</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

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 283839 $ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.idn-to-unicode">
<refnamediv>
<refname>idn_to_unicode</refname>
<refpurpose>&Alias; <function>idn_to_utf8</function></refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<simpara>
&info.function.alias;
<function>idn_to_utf8</function>.
</simpara>
</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

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 283819 $ -->
<refentry xml:id="function.idn-to-utf8" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>idn_to_utf8</refname>
<refpurpose>Convert domain name from IDNA ASCII to Unicode.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>Procedural style</para>
<methodsynopsis>
<type>string</type><methodname>idn_to_utf8</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam choice='opt'><type>int</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
This function converts Unicode domain name from IDNA ASCII-compatible format to plain Unicode.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>domain</parameter></term>
<listitem>
<para>
Domain to convert in IDNA ASCII-compatible format.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
Conversion options - combination of IDNA_* constants.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Domain name in Unicode. In PHP5, domain name will be in UTF-8.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>idn_to_utf8</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo idn_to_utf8('xn--tst-qla.de');
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
täst.de
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>idn_to_unicode</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

@ -134,6 +134,10 @@
<function name='intl_get_error_message' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0'/>
<function name='intl_is_failure' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0'/>
<function name='intl_error_name' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0'/>
<function name='idn_to_ascii' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.2'/>
<function name='idn_to_utf8' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.2'/>
<function name='idn_to_unicode' from='PHP 6'/>
<function name='locale_get_default' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0'/>
<function name='locale_set_default' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0'/>
<function name='locale_get_primary_language' from='PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0'/>