aboutsummaryrefslogtreecommitdiff
path: root/classes/CinIsis.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/CinIsis.php')
-rw-r--r--classes/CinIsis.php62
1 files changed, 0 insertions, 62 deletions
diff --git a/classes/CinIsis.php b/classes/CinIsis.php
deleted file mode 100644
index ff1de68..0000000
--- a/classes/CinIsis.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-
-/**
- * CinIsis main class.
- */
-class CinIsis {
- /**
- * @var $db
- * Database resource.
- */
- var $db;
-
- /**
- * @var $implementation
- * Database implementation.
- */
- var $implementation;
-
- /**
- * Constructor.
- *
- * @param $file
- * Optional parameter to set alternative config file.
- *
- * @todo
- * Config check.
- */
- function __construct($file = 'config/config.yaml') {
- try {
- // Load main configuration.
- $config = $this->config($file);
-
- // Load database schema.
- $schema = $this->config('schemas/'. $config['database'] .'.yaml');
- } catch (Exception $e) {
- echo '[cinisis] caught exception: ', $e->getMessage(), "\n";
- return FALSE;
- }
-
- // Setup database connection.
- $this->implementation = $config['implementation'] .'Db';
- $this->db = new $this->implementation($schema);
- }
-
- /**
- * Config file load.
- *
- * @param $file
- * Config file.
- *
- * @return
- * Array with configuration.
- */
- function config($file) {
- if (!file_exists($file)) {
- throw new Exception('Config '. $file .' not found.');
- }
-
- // Load configuration.
- return Spyc::YAMLLoad($file);
- }
-}