Esempio n. 1
0
 public function __construct()
 {
     $this->config = Config::getValue('database.connections.mysql');
     $this->drive = $this->config->driver;
     $this->host = $this->config->host;
     $this->dbname = $this->config->database;
     $this->user = $this->config->username;
     $this->password = $this->config->password;
     $this->charset = $this->config->charset;
     parent::__construct();
 }
Esempio n. 2
0
 public function __construct()
 {
     $default = Config::getValue('database.default');
     switch ($default) {
         case 'mysql':
             $this->database = new Mysql();
             break;
         default:
             echo 'ERROR: database not configured.';
             die;
     }
 }