aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-03-31 12:24:53 -0300
committerSilvio <silvio@devlet.com.br>2010-03-31 12:24:53 -0300
commit5eeabb67d7fa82ac230bb1a323ca3204d59b9915 (patch)
treea4294640a79931744d8e60e9f20716e943b05d90 /index.php
parenta39fb6bd4670137a4d682403bf80dd5d1b50ada2 (diff)
downloadcinisis-5eeabb67d7fa82ac230bb1a323ca3204d59b9915.tar.gz
cinisis-5eeabb67d7fa82ac230bb1a323ca3204d59b9915.tar.bz2
Adding classe CinIsis
Diffstat (limited to 'index.php')
-rw-r--r--index.php28
1 files changed, 12 insertions, 16 deletions
diff --git a/index.php b/index.php
index 3887b3d..42140d6 100644
--- a/index.php
+++ b/index.php
@@ -1,36 +1,32 @@
<?php
/**
- * Isis db migration tool.
+ * CinIsis - Isis db reading tool.
*/
// Import Malete Library.
-require 'contrib/malete/php/Isis.php';
+require_once 'contrib/malete/php/Isis.php';
// Import Spyc.
-require 'contrib/spyc/spyc.php';
+require_once 'contrib/spyc/spyc.php';
// Import Isis interface.
-require 'interface.php';
+require_once 'interface.php';
// Autoloader.
-function __autoload($class) {
+function cinisis_autoload($class) {
require_once 'classes/' .$class. '.php';
}
-// Load configuration.
-$config = Spyc::YAMLLoad('config/config.yaml');
+// Register autoloader.
+spl_autoload_register("cinisis_autoload");
-// Load database schema.
-$schema = Spyc::YAMLLoad('schemas/'. $config['database'] .'.yaml');
-
-// Setup database connection.
-$implementation = $config['implementation'] .'Db';
-$db = new $implementation($schema);
+// Get a db instance.
+$isis = new CinIsis();
// Test connection.
-if ($db) {
- $result = $db->read(1);
- $rows = $db->rows();
+if ($isis->db) {
+ $result = $isis->db->read(1);
+ $rows = $isis->db->rows();
// Format output.
echo '<pre>';