diff options
Diffstat (limited to 'doc/html/index.html')
-rw-r--r-- | doc/html/index.html | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/doc/html/index.html b/doc/html/index.html index 04bfaaa..4d42964 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -98,6 +98,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 ------------------ @@ -123,6 +129,49 @@ Example: 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). +</pre></div><h2>Example</h2> +<p>The following exemple shows how to read a database entry using two different ISIS backends:</p> +<div class="fragment"><pre class="fragment"><?php +<span class="comment">// Import requisites.</span> +require_once <span class="stringliteral">'../index.php'</span>; + +<span class="comment">// Draw the document.</span> +$display = <span class="keyword">new</span> <a class="code" href="classCinisisDisplayHelper.html">CinisisDisplayHelper</a>(<span class="stringliteral">'Isis Reader'</span>); +$display->open_table(); + +$configs = array( + 0 => array( + <span class="stringliteral">'implementation'</span> => <span class="stringliteral">'PhpIsis'</span>, + <span class="stringliteral">'database'</span> => <span class="stringliteral">'dbname'</span>, + ), + 1 => array( + <span class="stringliteral">'implementation'</span> => <span class="stringliteral">'BiblioIsis'</span>, + <span class="stringliteral">'database'</span> => <span class="stringliteral">'dbname'</span>, + ), +); + +<span class="keywordflow">foreach</span> ($configs as $config) { + <span class="comment">// Get a db instance.</span> + $isis = <span class="keyword">new</span> <a class="code" href="classCinisis.html">Cinisis</a>($config); + + <span class="comment">// Test connection.</span> + <span class="keywordflow">if</span> ($isis->db) { + $result = $isis->db->read(1); + $entries = $isis->db->entries(); + + <span class="comment">// Format output.</span> + echo <span class="stringliteral">'<td>'</span>; + echo <span class="stringliteral">'<pre>'</span>; + echo <span class="stringliteral">'Implementation: '</span>. $config[<span class="stringliteral">'implementation'</span>] .<span class="stringliteral">"\n"</span>; + echo <span class="stringliteral">"Rows: $entries\n"</span>; + print_r($result); + echo <span class="stringliteral">'</pre>'</span>; + echo <span class="stringliteral">'</td>'</span>; + } +} + +$display->close_table(); +$display->footer(); </pre></div> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" @@ -138,7 +187,7 @@ subfield is the data with qualifiers (like subfields a and b from above). </iframe> </div> -<hr class="footer"/><address class="footer"><small>Generated on Tue Feb 22 2011 11:43:15 for Cinisis Database Reader by +<hr class="footer"/><address class="footer"><small>Generated on Wed Feb 23 2011 11:44:08 for Cinisis Database Reader by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> |