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/html/index.html | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'doc/html/index.html') 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). +

Example

+

The following exemple shows how to read a database entry using two different ISIS backends:

+
<?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();
 
-