-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.php
188 lines (159 loc) · 5.22 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
/**
* Configuration
* **************
* There are some general purpose configuration, like Database settings
* or your base URL etc.
*/
class Config {
/**
* Database Configuration
* @var mixed - Key-Value pair Array.
*/
public $db = array(
'driver' => 'MySQL',
'host' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'yourdbname'
);
/**
* Base URL: Location where your site exists. Must begin with http or https
*
* This is important to show images or javascript/css files properly.
* \warning Please provide a slash (/) at the ending!
* \note Available by constant: BASE_URL
*
* @var string
*/
public $base_url = 'http://localhost/phpizza/';
// public $base_url = 'http://localhost/htdocs/projects/gigamvc/';
/**
* Templating/Theming
*
* Name the default theme/template for the site. There is a built-in template 'WhiteLove'
* You may also change template within your Controller class.
* \note Available by constant: SITE_THEME
*
* @var string
*/
public $site_theme = 'WhiteLove';
/**
* Landing Page
*
* This is the Controller path which is automatically loaded, if user does not
* provide any. For example, if user types http://example.com then this Controller class
* along with the View class will be loaded.
* \note Available by constant: LANDING_PAGE
*
* @var string
*/
public $landing_page = 'index';
/**
* Autoloads - These classes/files will be loaded automatically.
* Be careful when autoloading Custom classes this way. You do not need to autoload
* any custom class, because custom classes are loaded on-the-fly. If you autoload a custom
* class, it will be provided access to Core framework, which might be a security concern.
* So, only autoload custom classes you trust.
*
* @var mixed
*/
public $autoloads = array(
AUTOLOAD_CUSTOM_CLASS => array(), ///< Custom Classes
AUTOLOAD_MODEL => array(), ///< MODEL Classes
AUTOLOAD_CUSTOM_FUNCS => array(), ///< Custom Functions
AUTOLOAD_GENERAL_FUNCS => array('form') ///< General Functions
);
/**
* Clean/Nice URLs
*
* If enabled, all URLs generated by the site will be "clean" or "nice", i.e. yoursite.com/a/b/c
* - .htaccess should be activated.
* If disabled, URL will look like: yoursite.com?p=a/b/c
* \note Availabe by constant: NICE_URL_ENABLED
*
* @var bool
*/
public $nice_url_enabled = false;
/**
* Prints various information availabe for debugging. Must be set to false in a production server.
* \note Available by constant: DEBUG_MODE
*
* @var bool
*/
public $debug_mode = true;
/**
* URL Extention
* (Only effective if NICE_URL_ENABLED is set to true)
*
* All of your URLs will end with this extention. Provide with leading dot (for example: '.html')
* Leave empty, for no extentions.
*
* YOU MAY NEED TO CHANGE .htaccess FILE ACCORDINGLY IF YOU PUT ANY VALUE IN THIS! See line #10 of
* .htaccess file - in place of ".html" you may put your desired URL extention.
*
* @var string
*/
public $url_extention = '';
/**
* Default FunctionToCall
*
* This function will be called within your Controller class if not provided any.
*
* @var string
*/
public $default_function_to_call = 'index';
/*
* ***********************************************
* DO NOT CHANGE ANYTHING BEYOND THIS POINT!
* ***********************************************
*/
private static $instance;
private static $instanceCounter = 0;
/**
* Singleton Constructor
*/
private function __construct() {
}
/**
* Don't care this function. It allows only one instance of Config class for security issues.
*/
public static function getInstance() {
if (self::$instanceCounter === 0) {
self::$instanceCounter++;
self::$instance = new Config();
return self::$instance;
}
trigger_error('Access to Config class is denied!', E_USER_ERROR);
}
public function __clone() {
trigger_error('Clone is not allowed.', E_USER_ERROR);
}
public function __wakeup() {
trigger_error('Unserializing is not allowed.', E_USER_ERROR);
}
}
/**
* Constants
*/
//@{
/**
* System configuration : Never change following settings!
*/
define('PROJECT_DIR', dirname(__FILE__) . '/');
/**
* Internal Paths
*
* Do not change them. Modify only if you do understand what you are doing!
*/
define('CORE_DIR', PROJECT_DIR . 'core/');
// Or, you can mention full-path to core directory like:
//define('CORE_DIR', '/var/www/htdocs/projects/gigamvc/core/');
define('CUSTOM_DIR', PROJECT_DIR . 'custom/');
define('VIEW_DIR', PROJECT_DIR . 'VIEW/');
define('CONTROL_DIR', PROJECT_DIR . 'CONTROL/');
define('MODEL_DIR', PROJECT_DIR . 'MODEL/');
define('FORMS_DIR', VIEW_DIR . "forms/"); // Directory where your HTML forms reside
define('THIRDPARTY_DIR', PROJECT_DIR . '3rdparty/');
//@}
?>