Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Created March 4, 2009 10:49
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 wtnabe/73794 to your computer and use it in GitHub Desktop.
Save wtnabe/73794 to your computer and use it in GitHub Desktop.
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