Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
force switch database configuration for sad CakePHP 1.1.x
/**
* A Bad Knowhow for CakePHP 1.1.x
*
* force rewriting `default' setting
* because libs/session.php has hard-coded `default' !
*/
class DATABASE_CONFIG {
var $default = array( 'driver' => 'XXXXX',
'connect' => 'XXXXX',
'host' => 'XXXXX',
'login' => 'XXXXX',
'password' => 'XXXXX',
'database' => 'XXXXX',
'prefix' => 'XXXXX'
);
function DATABASE_CONFIG() {
if ( is_testing_environmont() ) {
$this->default = array( 'driver' => 'YYYYY',
'connect' => 'YYYYY',
'host' => 'YYYYY',
'login' => 'YYYYY',
'password' => 'YYYYY',
'database' => 'YYYYY',
'prefix' => 'YYYYY'
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment