From 37ca029f0fc8f35584f944a5df48a060a2d9b5e4 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 23 Feb 2011 11:45:39 -0300 Subject: Documentation update (4) --- doc/latex/index.tex | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'doc/latex/index.tex') diff --git a/doc/latex/index.tex b/doc/latex/index.tex index c8954a3..8611c8f 100644 --- a/doc/latex/index.tex +++ b/doc/latex/index.tex @@ -61,6 +61,12 @@ Cinisis config files are written in YAML. You'll need to download Spyc library from https://code.google.com/p/spyc/ and put the files at the contrib/ folder. +Configuration +------------- + + - Put your databases into the db folder, one folder per database. + - Optionally edit config/config.yaml to set the default database. + Naming conventions ------------------ @@ -87,4 +93,54 @@ For that entry we have fields 10 and 20, where field 10 has two rows (i.e, two repetitions). The main field is the data wich is has no qualifier (^) and a subfield is the data with qualifiers (like subfields a and b from above). \end{DoxyVerbInclude} + + +\subsection*{Example} + +The following exemple shows how to read a database entry using two different ISIS backends: + + +\begin{DoxyCodeInclude} +open_table(); + +$configs = array( + 0 => array( + 'implementation' => 'PhpIsis', + 'database' => 'dbname', + ), + 1 => array( + 'implementation' => 'BiblioIsis', + 'database' => 'dbname', + ), +); + +foreach ($configs as $config) { + // Get a db instance. + $isis = new Cinisis($config); + + // Test connection. + if ($isis->db) { + $result = $isis->db->read(1); + $entries = $isis->db->entries(); + + // Format output. + echo ''; + echo '
';
+    echo 'Implementation: '. $config['implementation'] ."\n";
+    echo "Rows: $entries\n";
+    print_r($result);
+    echo '
'; + echo ''; + } +} + +$display->close_table(); +$display->footer(); +\end{DoxyCodeInclude} \ No newline at end of file -- cgit v1.2.3