diff options
author | Silvio <silvio@devlet.com.br> | 2010-03-30 15:58:28 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-03-30 15:58:28 -0300 |
commit | 53db217fd2ee8e74895856037b9c98a6acf73159 (patch) | |
tree | 3df96971ff8ad828708a5230dcf72b9c08fb9996 | |
parent | 2fc4b766f4422f6a58c0a535fadf99096e7a9ddd (diff) | |
download | cinisis-53db217fd2ee8e74895856037b9c98a6acf73159.tar.gz cinisis-53db217fd2ee8e74895856037b9c98a6acf73159.tar.bz2 |
Adding config.yaml
-rw-r--r-- | config/config.yaml | 3 | ||||
-rw-r--r-- | index.php | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 0000000..0275926 --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,3 @@ +--- +implementation: Malete +database: anu10 @@ -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) { |