aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-03-30 15:58:28 -0300
committerSilvio <silvio@devlet.com.br>2010-03-30 15:58:28 -0300
commit53db217fd2ee8e74895856037b9c98a6acf73159 (patch)
tree3df96971ff8ad828708a5230dcf72b9c08fb9996 /index.php
parent2fc4b766f4422f6a58c0a535fadf99096e7a9ddd (diff)
downloadcinisis-53db217fd2ee8e74895856037b9c98a6acf73159.tar.gz
cinisis-53db217fd2ee8e74895856037b9c98a6acf73159.tar.bz2
Adding config.yaml
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/index.php b/index.php
index 21d4d18..37a8117 100644
--- a/index.php
+++ b/index.php
@@ -17,12 +17,15 @@ function __autoload($class) {
require_once 'classes/' .$class. '.php';
}
+// Load configuration.
+$config = Spyc::YAMLLoad('config/config.yaml');
+
// Load database schema.
-$schema = Spyc::YAMLLoad('schemas/anu10.yaml');
+$schema = Spyc::YAMLLoad('schemas/'. $config['database'] .'.yaml');
// Setup database connection.
-$db = new MaleteDb($schema);
-//$db = new PhpIsisDb($schema);
+$implementation = $config['implementation'] .'Db';
+$db = new $implementation($schema);
// Test connection.
if ($db) {