Skip to content

Instantly share code, notes, and snippets.

@pvalencia
Created March 15, 2010 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvalencia/332519 to your computer and use it in GitHub Desktop.
Save pvalencia/332519 to your computer and use it in GitHub Desktop.
<?php
class DATABASE_CONFIG {
var $development = array(
'driver' => 'sqlite',
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'development.sqlite',
'prefix' => '',
);
var $test = array(
'driver' => 'sqlite',
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'test.sqlite',
'prefix' => '',
);
var $production = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'database_name',
'prefix' => '',
);
var $default = array();
function __construct() {
$this->development['database'] = ROOT . DS . $this->development['database'];
$this->test['database'] = ROOT . DS . $this->test['database'];
if(Configure::read() > 0)
$this->default = $this->development;
else
$this->default = $this->production;
}
function DATABASE_CONFIG() {
$this->__construct();
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment