- Created setup.xml and examples.xml from book.xml

- Moved &reference.intl.reference; to bottom
- Added pecl.info info to configure.xml
- Removed building sect, as this is what 'pecl install' and pecl.info are for
- Refer to new ini.xml in new setup.xml


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@271950 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2008-12-26 21:31:42 +00:00
parent b4cc588a91
commit 202e313d5b
4 changed files with 139 additions and 154 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<book xml:id="book.intl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Internationalization Functions</title>
@ -84,145 +84,9 @@
</preface>
<!-- }}} -->
<!-- {{{ Setup -->
<chapter xml:id="intl.setup" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Installing/Configuring</title>
<!-- {{{ Requirements -->
<section xml:id="intl.requirements">
&reftitle.required;
<para>
To build the extension you need to install the
<link xlink:href="&url.icu.home;">ICU</link>
library of version 3.6+.
</para>
<para>
You will also need the latest version of PHP. Collator is known to work
well on PHP 5.1.3+ and 5.2.0+.
</para>
</section>
<!-- }}} -->
<!-- {{{ Installation -->
<section xml:id="intl.installation">
&reftitle.install;
<para>
Run:
<screen>
<![CDATA[
$ make install
]]>
</screen>
</para>
<para>
Then enable the extension by adding the following line to [PHP] section of
your &php.ini;:
<screen>
<![CDATA[
extension=intl.so
]]>
</screen>
</para>
</section>
<!-- }}} -->
<!-- {{{ Testing -->
<section xml:id="intl.testing">
<title>Testing</title>
<para>
Run:
<screen>
<![CDATA[
$ make test
]]>
</screen>
</para>
<para>
Note that the tests may fail if:
</para>
<itemizedlist>
<listitem>
<para>
The Collator extension is already enabled in
&php.ini;
</para>
</listitem>
<listitem>
<para>
LD_LIBRARY_PATH is used to load ICU libraries and value of the
'variables_order' setting in php.ini doesn't contain letter 'E' (missing
'E' means "do not register Environment variables");
</para>
</listitem>
</itemizedlist>
</section>
<!-- }}} -->
&reference.intl.configure;
<!-- {{{ Resources -->
<section xml:id="intl.resources">
&reftitle.resources;
&no.resource;
</section>
<!-- }}} -->
</chapter>
<!-- }}} -->
&reference.intl.setup;
&reference.intl.constants;
<!-- {{{ Examples -->
<appendix xml:id="intl.examples" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="intl.examples.basic">
<title>Basic usage of this extension</title>
<para>
Each module provides two kind of APIs: a procedural one and an object
oriented one. Both are actually identical and described in the
corresponding document.
</para>
<note>
<para>
All input strings must be in UTF-8 encoding. All output strings are
also in UTF-8.
</para>
</note>
<example>
<title>Example of using the procedural API</title>
<programlisting role="php">
<![CDATA[
<?php
$coll = collator_create('en_US');
$result = collator_compare($coll, "string#1", "string#2");
?>
]]>
</programlisting>
</example>
<example>
<title>Example of using the object-oriented API</title>
<programlisting role="php">
<![CDATA[
<?php
$coll = new Collator('en_US');
$al = $coll->getLocale(Locale::ACTUAL_LOCALE);
echo "Actual locale: $al\n";
$formatter = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
echo $formatter->format(1234567);
?>
]]>
</programlisting>
</example>
</section>
</appendix>
<!-- }}} -->
&reference.intl.reference;
&reference.intl.examples;
&reference.intl.collator;
&reference.intl.numberformatter;
@ -231,6 +95,7 @@ echo $formatter->format(1234567);
&reference.intl.messageformatter;
&reference.intl.dateformatter;
&reference.intl.reference;
</book>
<!-- Keep this comment at the end of the file

View file

@ -1,21 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.2 $ -->
<section xml:id="intl.building" xmlns="http://docbook.org/ns/docbook">
<title>Building</title>
<!-- $Revision: 1.3 $ -->
<section xml:id="intl.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.install;
<para>
Let's assume that you have installed PHP to
<emphasis>/opt/php5/</emphasis>
and ICU is installed to
<emphasis>/opt/icu/</emphasis>. Run the following commands:
&pecl.info;
<link xlink:href="&url.pecl.package;intl">&url.pecl.package;intl</link>.
</para>
<screen>
<![CDATA[
$ /opt/php5/bin/phpize
$ ./configure --with-php-config=/opt/php5/bin/php-config --with-icu-dir=/opt/icu
$ make
]]>
</screen>
<para>
If your ICU is installed to a non-standard directory then you might want to
specify its location in

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<chapter xml:id="intl.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="intl.examples.basic">
<title>Basic usage of this extension</title>
<para>
Each module provides two kind of APIs: a procedural one and an object
oriented one. Both are actually identical and described in the
corresponding document.
</para>
<note>
<para>
All input strings must be in UTF-8 encoding. All output strings are
also in UTF-8.
</para>
</note>
<example>
<title>Example of using the procedural API</title>
<programlisting role="php">
<![CDATA[
<?php
$coll = collator_create('en_US');
$result = collator_compare($coll, "string#1", "string#2");
?>
]]>
</programlisting>
</example>
<example>
<title>Example of using the object-oriented API</title>
<programlisting role="php">
<![CDATA[
<?php
$coll = new Collator('en_US');
$al = $coll->getLocale(Locale::ACTUAL_LOCALE);
echo "Actual locale: $al\n";
$formatter = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
echo $formatter->format(1234567);
?>
]]>
</programlisting>
</example>
</section>
</chapter>
<!-- 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
-->

59
reference/intl/setup.xml Normal file
View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<chapter xml:id="intl.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.setup;
<!-- {{{ Requirements -->
<section xml:id="intl.requirements">
&reftitle.required;
<para>
To build the extension you need to install the
<link xlink:href="&url.icu.home;">ICU</link>
library of version 3.6+.
</para>
<para>
You will also need the latest version of PHP. Collator is known to work
well on PHP 5.1.3+ and 5.2.0+.
</para>
</section>
<!-- }}} -->
<!-- {{{ Installation -->
&reference.intl.configure;
<!-- }}} -->
<!-- {{{ Configuration -->
&reference.intl.ini;
<!-- }}} -->
<!-- {{{ Resources -->
<section xml:id="intl.resources">
&reftitle.resources;
&no.resource;
</section>
<!-- }}} -->
</chapter>
<!-- 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
-->