diff options
author | Silvio <silvio@devlet.com.br> | 2011-02-23 11:45:39 -0300 |
---|---|---|
committer | Silvio Rhatto <silvio@devlet.com.br> | 2011-02-23 11:45:39 -0300 |
commit | 37ca029f0fc8f35584f944a5df48a060a2d9b5e4 (patch) | |
tree | 22a9bcf84c0d72ed75a822db8520f92661299d7f /doc/latex/index.tex | |
parent | 07563f53baedcf6085b4467dd4659b1d0e0ab17a (diff) | |
download | cinisis-master.tar.gz cinisis-master.tar.bz2 |
Diffstat (limited to 'doc/latex/index.tex')
-rw-r--r-- | doc/latex/index.tex | 56 |
1 files changed, 56 insertions, 0 deletions
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} +<?php +// Import requisites. +require_once '../index.php'; + +// Draw the document. +$display = new CinisisDisplayHelper('Isis Reader'); +$display->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 '<td>'; + echo '<pre>'; + echo 'Implementation: '. $config['implementation'] ."\n"; + echo "Rows: $entries\n"; + print_r($result); + echo '</pre>'; + echo '</td>'; + } +} + +$display->close_table(); +$display->footer(); +\end{DoxyCodeInclude}
\ No newline at end of file |