This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.config.php
51 lines (46 loc) · 1.84 KB
/
example.config.php
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
44
45
46
47
48
49
50
51
<?php if (!defined('BASE_PATH')) die('You can not access this directly');
// comment block {{{
/* vim: set expandtab tabstop=3 shiftwidth=3: */
// +--------------------------------------------------------+
// | PHP Version 5.x |
// +--------------------------------------------------------+
// | Filename: example.config.php |
// +--------------------------------------------------------+
// | Copyright (c) 2008 Joel Hansson |
// +--------------------------------------------------------+
// | License: MIT |
// +--------------------------------------------------------+
// | Author: Joel Hansson <[email protected]> |
// +--------------------------------------------------------+
//
// }}}
class Config
{
public static $DB_HOST = 'localhost';
public static $DB_USER = 'root';
public static $DB_PASSWORD = '';
public static $DB_DATABASE = 'my_database';
public static $DB_MANAGER = 'mysql';
public static $DB_DSN = '';
public static $TEMPLATE_DIR = 'app/views/';
public static $TIMEZONE = 'Europe/Stockholm';
public static $LOCAL = 'sv_SE';
public static $DEBUG = true;
public static $DISPLAY_ERRORS = 1;
public static $ERROR_REP = E_ALL;
// static setDefaults() {{{
public static function setDefaults()
{
Config::setDSN('development');
} // }}}
// static setDSN() {{{
public static function setDSN($mode = 'development')
{
$dbname = ($mode == 'test') ? self::$DB_DATABASE_TEST : self::$DB_DATABASE;
self::$DB_DSN = self::$DB_MANAGER.':dbname='.$dbname.';'.
'host='.self::$DB_HOST;
} // }}}
}
// set default values
Config::setDefaults();
?>