32 lines
842 B
PHP
32 lines
842 B
PHP
<?php
|
|
|
|
//CakePHP is pretty awful. I was so foolish.
|
|
|
|
class DATABASE_CONFIG {
|
|
|
|
var $default = array(
|
|
'driver' => 'mysql',
|
|
'persistent' => false,
|
|
'host' => '172.17.0.1',
|
|
'login' => 'cmc',
|
|
'password' => 'xVRQI&cA?7AU=hqJ!%au',
|
|
'database' => 'cmc',
|
|
'prefix' => '',
|
|
);
|
|
|
|
function __construct() {
|
|
// Use environment-specific database settings if APP_ENV is set
|
|
if (isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] == 'staging') {
|
|
$this->default = array(
|
|
'driver' => 'mysql',
|
|
'persistent' => false,
|
|
'host' => 'db-staging',
|
|
'login' => 'cmc_staging',
|
|
'password' => 'staging_password',
|
|
'database' => 'cmc_staging',
|
|
'prefix' => '',
|
|
);
|
|
}
|
|
}
|
|
}
|