svn: /phpdoc/en/trunk/reference/intl/resourcebundle/ locales.xml
| From: | Justin Martin | Date: | Mon, 05 Dec 2011 21:35:52 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/intl/resourcebundle/ locales.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-9159@lists.php.net to get a copy of this message | ||
frozenfire Mon, 05 Dec 2011 21:35:52 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=320463
Log:
Fixed and clarified both the procedural and OOP variants, and updated examples. Addresses bug
#53995.
Bug: https://bugs.php.net/53995 (Open)
resourcebundle_locales wait a string
Changed paths:
U phpdoc/en/trunk/reference/intl/resourcebundle/locales.xml
Modified: phpdoc/en/trunk/reference/intl/resourcebundle/locales.xml
===================================================================
--- phpdoc/en/trunk/reference/intl/resourcebundle/locales.xml 2011-12-05 21:17:50 UTC (rev 320462)
+++ phpdoc/en/trunk/reference/intl/resourcebundle/locales.xml 2011-12-05 21:35:52 UTC (rev 320463)
@@ -15,7 +15,7 @@
<methodsynopsis>
<type>array</type>
<methodname>ResourceBundle::getLocales</methodname>
- <void />
+
<methodparam><type>string</type><parameter>bundlename</parameter></methodparam>
</methodsynopsis>
<para>
Procedural style
@@ -23,13 +23,10 @@
<methodsynopsis>
<type>array</type>
<methodname>resourcebundle_locales</methodname>
-
<methodparam><type>ResourceBundle</type><parameter>r</parameter></methodparam>
+
<methodparam><type>string</type><parameter>bundlename</parameter></methodparam>
</methodsynopsis>
<para>
- Get the list of locales supported by the bundle. The list is taken from the bundle table
- named <code>res_index</code> which should contain a table named
<code>InstalledLocales</code>,
- which contains locales as keys. This bundle should be either in data directory as .res file or
- part of the .dat file for this function to work.
+ Get available locales from ResourceBundle name.
</para>
</refsect1>
@@ -38,10 +35,11 @@
<para>
<variablelist>
<varlistentry>
- <term><parameter>r</parameter></term>
+ <term><parameter>bundlename</parameter></term>
<listitem>
<para>
- <classname>ResourceBundle</classname> object.
+ Path of ResourceBundle for which to get available locales, or
+ empty string for default locales list.
</para>
</listitem>
</varlistentry>
@@ -64,23 +62,31 @@
<programlisting role="php">
<![CDATA[
<?php
-$r = resourcebundle_create( 'es', "/usr/share/data/myapp");
-echo join("\n", resourcebundle_locales($r));
+$bundle = "/user/share/data/myapp";
+echo join(PHP_EOL, resourcebundle_locales($bundle);
?>
]]>
</programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+es
+root
+]]>
+ </screen>
</example>
<example>
<title>OO example</title>
<programlisting role="php">
<![CDATA[
<?php
-$r = new ResourceBundle( 'es', "/usr/share/data/myapp");
-echo join("\n", $r->getLocales());
+$bundle = "/usr/share/data/myapp";
+$r = new ResourceBundle( 'es', $bundle);
+echo join("\n", $r->getLocales($bundle));
?>
]]>
</programlisting>
- &example.outputs;
+ &example.outputs.similar;
<screen>
<![CDATA[
es