Skip to content

Instantly share code, notes, and snippets.

@agborkowski
Last active December 12, 2015 05:08
Show Gist options
  • Save agborkowski/4719635 to your computer and use it in GitHub Desktop.
Save agborkowski/4719635 to your computer and use it in GitHub Desktop.
<?php
/*
cakephp 1.2 database configuration for different environments
@author AgBorkowski
@link http://blog.aeonmedia.eu/2013/02/good-way-to-change-in-easy-way-application-environment
*/
class DATABASE_CONFIG {
public $default = array();
function __construct() {
if (APPLICATION_ENV === 'production') {
$this->default = array(
'driver' => 'mysql',
'persistent' => true,
'host' => 'production.host',
'login' => '',
'password' => '',
'database' => ''
#,'encoding' => 'utf8'
);
} else {
$this->default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => '',
'password' => '',
'database' => '',
'encoding' => 'utf8'
);
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment