aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
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) {