cvs: peardoc /en/package/fileformats/file-fortune example.xml /en/package/fileformats/file-fortune/file-fortune --construct.xml add.xml create.xml
delete.xml getall.xml getdirectory.xml getrandom.xml save.xml setfile.xml setfiles.xml update.xml
| From: | Matthew Weier O'Phinney | Date: | Sun, 08 Jul 2007 16:12:47 +0000 |
| Subject: | cvs: peardoc /en/package/fileformats/file-fortune example.xml /en/package/fileformats/file-fortune/file-fortune --construct.xml add.xml create.xml delete.xml getall.xml getdirectory.xml getrandom.xml save.xml setfile.xml setfiles.xml update.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9886@lists.php.net to get a copy of this message | ||
weierophinney Sun Jul 8 16:12:47 2007 UTC
Modified files:
/peardoc/en/package/fileformats/file-fortune example.xml
/peardoc/en/package/fileformats/file-fortune/file-fortune
--construct.xml
add.xml
create.xml
delete.xml
getall.xml
getdirectory.xml
getrandom.xml
save.xml
setfile.xml
setfiles.xml
update.xml
Log:
* Updated docs to reflect 1.0.0RC1
* Minor formatting corrections
http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/example.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/example.xml diff -u peardoc/en/package/fileformats/file-fortune/example.xml:1.2 peardoc/en/package/fileformats/file-fortune/example.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/example.xml:1.2 Fri Jul 6 12:35:19 2007 +++ peardoc/en/package/fileformats/file-fortune/example.xml Sun Jul 8 16:12:47 2007 @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.fileformats.file-fortune.example"> <refnamediv> - <refname>Example</refname> + <refname>Examples</refname> <refpurpose> - Below are some common use cases. + Common use cases. </refpurpose> </refnamediv> @@ -37,6 +37,10 @@ $fortunes = new File_Fortune('/path/to/fortune/file'); $cached = $fortunes->getAll(); + +// or all fortunes in all files: +$fortunes->setDirectory('/path/to/fortunes/'); +$cached = $fortunes->getAll(); ?> ]]> </programlisting> @@ -51,6 +55,10 @@ $fortunes = new File_Fortune('/path/to/fortune/file'); $count = count($fortunes); + +// or all fortunes in all files: +$fortunes->setDirectory('/path/to/fortunes/'); +$count = count($fortunes); ?> ]]> </programlisting> @@ -70,6 +78,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.example.example5"> @@ -89,6 +101,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.example.example6"> @@ -103,6 +119,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.example.example7"> @@ -123,6 +143,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml:1.1 peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml:1.2 --- peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml:1.1 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml Sun Jul 8 16:12:47 2007 @@ -18,7 +18,7 @@ <function>File_Fortune::__construct</function> </funcdef> <paramdef> - string + string|array <parameter> <optional>$file = &null;</optional> </parameter> @@ -46,11 +46,12 @@ <variablelist> <varlistentry> <term> - &type.string; + &type.string;|&type.array; <parameter>$file</parameter> </term> <listitem> - <para>Fortune file name, or name of a directory containing fortune files. </para> + <para>Fortune file name, or name of a directory containing fortune files.</para> + <para>If passing an array, array of fortune files names.</para> </listitem> </varlistentry> </variablelist> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml Sun Jul 8 16:12:47 2007 @@ -40,6 +40,8 @@ <listitem> <para>Fortune string to add to fortune file. Fortune will be appended to fortune file.</para> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </listitem> </varlistentry> </variablelist> @@ -49,7 +51,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.add.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml:1.3 peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml:1.4 --- peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml:1.3 Sat Jul 7 15:36:40 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml Sun Jul 8 16:12:47 2007 @@ -62,7 +62,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.create.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml Sun Jul 8 16:12:47 2007 @@ -31,6 +31,8 @@ <?php unset($fortunes[$index]); ]]></programlisting> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.delete.param"> &title.param; @@ -52,7 +54,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.delete.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml Sun Jul 8 16:12:47 2007 @@ -20,7 +20,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.getall.desc"> &title.desc; <para> - <function>getAll()</function> can be used to pull the entire fortune + <function>getAll</function> can be used to pull the entire fortune database into an array. Typically this is a bad idea as fortune files are often very large. If you wish to do some processing with each fortune, use the <classname>File_Fortune</classname> object as an iterator: @@ -32,6 +32,11 @@ } ?> ]]></programlisting> + <para> + <emphasis>Note:</emphasis> you can use <function>getAll</function> when a + directory or multiple files have been set; in such a context, it will + return all fortunes in all files. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.getall.throws"> &title.throws; http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml Sun Jul 8 16:12:47 2007 @@ -20,7 +20,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.getdirectory.desc"> &title.desc; <para> - <function>getDirectory()</function> returns the currently registered + <function>getDirectory</function> returns the currently registered fortune file directory, if any. </para> </refsect1> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml Sun Jul 8 16:12:47 2007 @@ -20,7 +20,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.getrandom.desc"> &title.desc; <para> - <function>getRandom()</function> pulls a random fortune. If a fortune file + <function>getRandom</function> pulls a random fortune. If a fortune file has been explicitly specified, the fortune will be pulled from that file; if a directory has been specified, a random fortune file will first be selected. http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml Sun Jul 8 16:12:47 2007 @@ -25,12 +25,14 @@ out of scope. However, if you wish to manually ensure that changes are set, you may call <function>save()</function>. </para> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.save.throws"> &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.save.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml Sun Jul 8 16:12:47 2007 @@ -33,7 +33,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.setfile.desc"> &title.desc; <para> - <function>setFile()</function> may be used to explicitly set a fortune + <function>setFile</function> may be used to explicitly set a fortune file to use or create. </para> </refsect1> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml:1.1 peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml:1.2 --- peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml:1.1 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml Sun Jul 8 16:12:47 2007 @@ -24,7 +24,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.setfiles.desc"> &title.desc; <para> - <function>setFiles()</function> may be used to define a list of files from + <function>setFiles</function> may be used to define a list of files from which to pull fortunes. You may pass either a string single argument, an array single argument, or multiple string arguments. As examples: </para> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml Sun Jul 8 16:12:47 2007 @@ -34,6 +34,8 @@ <?php $fortunes[2] = 'Updated fortunes are fun!'; ]]></programlisting> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.update.param"> &title.param; @@ -66,7 +68,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.update.note">
http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/example.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/example.xml diff -u peardoc/en/package/fileformats/file-fortune/example.xml:1.2 peardoc/en/package/fileformats/file-fortune/example.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/example.xml:1.2 Fri Jul 6 12:35:19 2007 +++ peardoc/en/package/fileformats/file-fortune/example.xml Sun Jul 8 16:12:47 2007 @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.fileformats.file-fortune.example"> <refnamediv> - <refname>Example</refname> + <refname>Examples</refname> <refpurpose> - Below are some common use cases. + Common use cases. </refpurpose> </refnamediv> @@ -37,6 +37,10 @@ $fortunes = new File_Fortune('/path/to/fortune/file'); $cached = $fortunes->getAll(); + +// or all fortunes in all files: +$fortunes->setDirectory('/path/to/fortunes/'); +$cached = $fortunes->getAll(); ?> ]]> </programlisting> @@ -51,6 +55,10 @@ $fortunes = new File_Fortune('/path/to/fortune/file'); $count = count($fortunes); + +// or all fortunes in all files: +$fortunes->setDirectory('/path/to/fortunes/'); +$count = count($fortunes); ?> ]]> </programlisting> @@ -70,6 +78,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.example.example5"> @@ -89,6 +101,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.example.example6"> @@ -103,6 +119,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.example.example7"> @@ -123,6 +143,10 @@ ?> ]]> </programlisting> + <para> + Note: this will raise exceptions if a directory or multiple files have + been set. + </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml:1.1 peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml:1.2 --- peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml:1.1 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/--construct.xml Sun Jul 8 16:12:47 2007 @@ -18,7 +18,7 @@ <function>File_Fortune::__construct</function> </funcdef> <paramdef> - string + string|array <parameter> <optional>$file = &null;</optional> </parameter> @@ -46,11 +46,12 @@ <variablelist> <varlistentry> <term> - &type.string; + &type.string;|&type.array; <parameter>$file</parameter> </term> <listitem> - <para>Fortune file name, or name of a directory containing fortune files. </para> + <para>Fortune file name, or name of a directory containing fortune files.</para> + <para>If passing an array, array of fortune files names.</para> </listitem> </varlistentry> </variablelist> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/add.xml Sun Jul 8 16:12:47 2007 @@ -40,6 +40,8 @@ <listitem> <para>Fortune string to add to fortune file. Fortune will be appended to fortune file.</para> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </listitem> </varlistentry> </variablelist> @@ -49,7 +51,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.add.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml:1.3 peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml:1.4 --- peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml:1.3 Sat Jul 7 15:36:40 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/create.xml Sun Jul 8 16:12:47 2007 @@ -62,7 +62,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.create.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/delete.xml Sun Jul 8 16:12:47 2007 @@ -31,6 +31,8 @@ <?php unset($fortunes[$index]); ]]></programlisting> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.delete.param"> &title.param; @@ -52,7 +54,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.delete.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/getall.xml Sun Jul 8 16:12:47 2007 @@ -20,7 +20,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.getall.desc"> &title.desc; <para> - <function>getAll()</function> can be used to pull the entire fortune + <function>getAll</function> can be used to pull the entire fortune database into an array. Typically this is a bad idea as fortune files are often very large. If you wish to do some processing with each fortune, use the <classname>File_Fortune</classname> object as an iterator: @@ -32,6 +32,11 @@ } ?> ]]></programlisting> + <para> + <emphasis>Note:</emphasis> you can use <function>getAll</function> when a + directory or multiple files have been set; in such a context, it will + return all fortunes in all files. + </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.getall.throws"> &title.throws; http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/getdirectory.xml Sun Jul 8 16:12:47 2007 @@ -20,7 +20,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.getdirectory.desc"> &title.desc; <para> - <function>getDirectory()</function> returns the currently registered + <function>getDirectory</function> returns the currently registered fortune file directory, if any. </para> </refsect1> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/getrandom.xml Sun Jul 8 16:12:47 2007 @@ -20,7 +20,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.getrandom.desc"> &title.desc; <para> - <function>getRandom()</function> pulls a random fortune. If a fortune file + <function>getRandom</function> pulls a random fortune. If a fortune file has been explicitly specified, the fortune will be pulled from that file; if a directory has been specified, a random fortune file will first be selected. http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/save.xml Sun Jul 8 16:12:47 2007 @@ -25,12 +25,14 @@ out of scope. However, if you wish to manually ensure that changes are set, you may call <function>save()</function>. </para> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.save.throws"> &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.save.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/setfile.xml Sun Jul 8 16:12:47 2007 @@ -33,7 +33,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.setfile.desc"> &title.desc; <para> - <function>setFile()</function> may be used to explicitly set a fortune + <function>setFile</function> may be used to explicitly set a fortune file to use or create. </para> </refsect1> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml:1.1 peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml:1.2 --- peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml:1.1 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/setfiles.xml Sun Jul 8 16:12:47 2007 @@ -24,7 +24,7 @@ <refsect1 id="package.fileformats.file-fortune.file-fortune.setfiles.desc"> &title.desc; <para> - <function>setFiles()</function> may be used to define a list of files from + <function>setFiles</function> may be used to define a list of files from which to pull fortunes. You may pass either a string single argument, an array single argument, or multiple string arguments. As examples: </para> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml diff -u peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml:1.2 peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml:1.3 --- peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml:1.2 Fri Jul 6 12:34:55 2007 +++ peardoc/en/package/fileformats/file-fortune/file-fortune/update.xml Sun Jul 8 16:12:47 2007 @@ -34,6 +34,8 @@ <?php $fortunes[2] = 'Updated fortunes are fun!'; ]]></programlisting> + <para>If multiple files or a directory have been set, you cannot + manipulate the fortune list, and this method will raise an exception.</para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.update.param"> &title.param; @@ -66,7 +68,7 @@ &title.throws; <para> <emphasis>throws</emphasis> - no exceptions thrown + <classname>File_Fortune_Exception</classname> </para> </refsect1> <refsect1 id="package.fileformats.file-fortune.file-fortune.update.note">