cvs: peardoc /en/package/structures/structures-bibtex intro.xml warnings.xml

From: Date: Sat, 22 Jul 2006 08:34:17 +0000
Subject: cvs: peardoc /en/package/structures/structures-bibtex intro.xml warnings.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8162@lists.php.net to get a copy of this message
hugoki Sat Jul 22 08:34:17 2006 UTC Modified files: /peardoc/en/package/structures/structures-bibtex intro.xml warnings.xml Log: - The examples should now be CS conform - Added some words about the stored data http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-bibtex/intro.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/structures/structures-bibtex/intro.xml diff -u peardoc/en/package/structures/structures-bibtex/intro.xml:1.2 peardoc/en/package/structures/structures-bibtex/intro.xml:1.3 --- peardoc/en/package/structures/structures-bibtex/intro.xml:1.2 Sat Jul 15 16:08:53 2006 +++ peardoc/en/package/structures/structures-bibtex/intro.xml Sat Jul 22 08:34:17 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.structures.structures-bibtex.intro"> <refnamediv> <refname>Introduction</refname> @@ -24,23 +24,85 @@ <title>Loading a BibTex File and printing the parsed array</title> <programlisting role="php"> <![CDATA[ -require_once ('Structures/BibTex.php'); -$foo = new Structures_BibTex(); -$ret=$foo->loadFile('foo.bib'); +require_once 'Structures/BibTex.php'; +$bibtex = new Structures_BibTex(); +$ret = $bibtex->loadFile('foo.bib'); if (PEAR::isError($ret)) { - print $ret->getMessage(); - die(); + die($ret->getMessage()); } -$foo->parse(); -print '<pre>'; +$bibtex->parse(); +echo '<pre>'; print_r($foo->data); -print '</pre>'; +echo '</pre>'; ]]> </programlisting> </example> </refsect1> - </refentry> - + +<refsect1 id="package.structures.structures-bibtex.intro.storeddata"> + <title>Stored Data</title> + <para> + The data is stored in the class variable <varname>data</varname>. This is a + a list where each entry is a hash table representing one bibtex-entry. The keys + of the hash table correspond to the keys used in bibtex and the values are the + corresponding values. Some of these keys are: + <itemizedlist> + <listitem> + <para> + <parameter>cite</parameter> - The key used in a LaTeX source to do the citing. + </para> + </listitem> + <listitem> + <para> + <parameter>type</parameter> - The type of the entry, like techreport, book and so on. + </para> + </listitem> + <listitem> + <para> + <parameter>author</parameter> - One or more authors of the entry. This entry is also a list with hash tables representing the authors as entries. The author has table is explained later. + </para> + </listitem> + <listitem> + <para> + <parameter>title</parameter> - Title of the entry. + </para> + </listitem> + </itemizedlist> + </para> +</refsect1> + +<refsect1 id="package.structures.structures-bibtex.intro.author"> + <title>Author</title> + <para> + As described before the authors are stored in a list. Every entry representing + one author as a has table. The hash table consits of four keys: first, von, last + and jr. The keys are explained in the following list: + <itemizedlist> + <listitem> + <para> + <parameter>first</parameter> - The first name of the author. + </para> + </listitem> + <listitem> + <para> + <parameter>von</parameter> - Some names have a 'von' part in their name. This is usually a sign of nobleness. + </para> + </listitem> + <listitem> + <para> + <parameter>last</parameter> - The last name of the author. + </para> + </listitem> + <listitem> + <para> + <parameter>jr</parameter> - Sometimes a author is the son of his father and has the same name, then the value would be jr. The same is true for the value sen but vice versa. + </para> + </listitem> + </itemizedlist> + </para> +</refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-bibtex/warnings.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/structures/structures-bibtex/warnings.xml diff -u peardoc/en/package/structures/structures-bibtex/warnings.xml:1.1 peardoc/en/package/structures/structures-bibtex/warnings.xml:1.2 --- peardoc/en/package/structures/structures-bibtex/warnings.xml:1.1 Sat Jul 15 16:09:20 2006 +++ peardoc/en/package/structures/structures-bibtex/warnings.xml Sat Jul 22 08:34:17 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.structures.structures-bibtex.warnings"> <refnamediv> <refname>Warnings</refname> @@ -22,9 +22,9 @@ <title>Switching off creation of warnings</title> <programlisting role="php"> <![CDATA[ -require_once ('Structures/BibTex.php'); -$foo = new Structures_BibTex(); -$foo->setOption('validate', false); +require_once 'Structures/BibTex.php'; +$bibtex = new Structures_BibTex(); +$bibtex->setOption('validate', false); ]]> </programlisting> </example> @@ -41,16 +41,15 @@ <title>Checking for warnings</title> <programlisting role="php"> <![CDATA[ -require_once ('Structures/BibTex.php'); -$foo = new Structures_BibTex(); -$ret=$foo->loadFile('foo.bib'); +require_once 'Structures/BibTex.php'; +$bibtex = new Structures_BibTex(); +$ret = $bibtex->loadFile('foo.bib'); if (PEAR::isError($ret)) { - print $ret->getMessage(); - die(); + die($ret->getMessage()); } -$foo->parse(); -if ($foo->hasWarning()) { - print 'There are warnings!<br />'; +$bibtex->parse(); +if ($bibtex->hasWarning()) { + print 'There are warnings!<br />'; } ]]> </programlisting> @@ -78,19 +77,18 @@ <title>Checking for warnings</title> <programlisting role="php"> <![CDATA[ -require_once ('Structures/BibTex.php'); -$foo = new Structures_BibTex(); -$ret=$foo->loadFile('foo.bib'); +require_once 'Structures/BibTex.php'; +$bibtex = new Structures_BibTex(); +$ret = $bibtex->loadFile('foo.bib'); if (PEAR::isError($ret)) { - print $ret->getMessage(); - die(); + die($ret->getMessage()); } -$foo->parse(); - if ($foo->hasWarning()) { - foreach($foo->warnings as $warning) { - print 'Warning: '.$warning['warning'].'<br />'; - print 'Line: '.$warning['entry'].'<hr />'; - } +$bibtex->parse(); +if ($bibtex->hasWarning()) { + foreach ($bibtex->warnings as $warning) { + echo 'Warning: '.$warning['warning'].'<br />'; + echo 'Line: '.$warning['entry'].'<hr />'; + } } ]]> </programlisting>

« previous php.pear.doc (#8162) next »