Bin will be removed on June 1, 2014 in favor of http://gist.github.com. Please save all your pastes before then. So long, and thanks for all the fish!×
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// APP/config/bootstrap.php
 
if (.... dev server specific ...)) {
        Configure::write('App.server');
        Configure::write('debug', 2);
        Configure::write('debugSessions', true);
        Configure::write('Cache.disable', true);
}
else {
        Configure::write('App.server', 'live');
        Configure::write('debug', 0);
        Configure::write('Cache.disable', false);
}
 
// App/config/database.php
 
class DATABASE_CONFIG {
 
    var $default = null;
 
    var $dev = array(
        'driver' => 'mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'loginname',
        'password' => 'passwd',
        'database' => 'db_dev',
        'prefix' => '',
    );
    var $live = array(
        'driver' => 'mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'login',
        'password' => 'passwd',
        'database' => 'db_live',
        'prefix' => '',
    );
   
    function DATABASE_CONFIG() {
        $this->default = $this->{Configure::read('Markt.server')};
    }
}