forked from onPHP/onphp-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.inc.php
205 lines (157 loc) · 7.34 KB
/
config.inc.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php
/***************************************************************************
* Copyright (C) 2004-2009 by Konstantin V. Arkhipov *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 3 of the *
* License, or (at your option) any later version. *
* *
***************************************************************************/
// sample system-wide configuration file
function error2Exception($code, $string, $file, $line, $context)
{
if (error_reporting() == 0 && strpos($file, '/vendor/') !== false) {
// silented by "@", this is only allowed for external libs
return;
}
throw new BaseException($string, $code);
}
// file extensions
define('EXT_CLASS', '.class.php');
define('EXT_TPL', '.tpl.html');
define('EXT_MOD', '.inc.php');
define('EXT_HTML', '.html');
define('EXT_UNIT', '.unit.php');
define('EXT_LIB', '.php');
// overridable constant, don't forget for trailing slash
// also you may consider using /dev/shm/ for cache purposes
if (!defined('ONPHP_TEMP_PATH'))
define(
'ONPHP_TEMP_PATH',
sys_get_temp_dir().DIRECTORY_SEPARATOR.'onPHP'.DIRECTORY_SEPARATOR
);
if (!defined('ONPHP_CLASS_CACHE'))
define('ONPHP_CLASS_CACHE', ONPHP_TEMP_PATH);
// classes autoload magic
if (!defined('ONPHP_CLASS_CACHE_TYPE'))
define('ONPHP_CLASS_CACHE_TYPE', 'classPathCache');
require
dirname(__FILE__).DIRECTORY_SEPARATOR
.'misc'.DIRECTORY_SEPARATOR
.'Autoloader'.EXT_MOD;
// system settings
error_reporting(E_ALL | E_STRICT);
set_error_handler('error2Exception', E_ALL | E_STRICT);
ignore_user_abort(true);
define('ONPHP_VERSION', '1.0.10.99');
date_default_timezone_set('Europe/Moscow');
if (!defined('ONPHP_IPC_PERMS'))
define('ONPHP_IPC_PERMS', 0660);
// paths
define('ONPHP_ROOT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
define('ONPHP_CORE_PATH', ONPHP_ROOT_PATH.'core'.DIRECTORY_SEPARATOR);
define('ONPHP_MAIN_PATH', ONPHP_ROOT_PATH.'main'.DIRECTORY_SEPARATOR);
define('ONPHP_META_PATH', ONPHP_ROOT_PATH.'meta'.DIRECTORY_SEPARATOR);
define('ONPHP_UI_PATH', ONPHP_ROOT_PATH.'UI'.DIRECTORY_SEPARATOR);
define('ONPHP_LIB_PATH', ONPHP_ROOT_PATH.'lib'.DIRECTORY_SEPARATOR);
spl_autoload_register(array('Autoloader', ONPHP_CLASS_CACHE_TYPE), false);
if (!defined('ONPHP_META_PATH'))
define(
'ONPHP_META_PATH',
ONPHP_ROOT_PATH.'meta'.DIRECTORY_SEPARATOR
);
define('ONPHP_META_CLASSES', ONPHP_META_PATH.'classes'.DIRECTORY_SEPARATOR);
define(
'ONPHP_INCUBATOR_PATH',
ONPHP_ROOT_PATH.'incubator'.DIRECTORY_SEPARATOR
);
set_include_path(
// current path
get_include_path().PATH_SEPARATOR
// core classes
.ONPHP_CORE_PATH.'Base' .PATH_SEPARATOR
.ONPHP_CORE_PATH.'Cache' .PATH_SEPARATOR
.ONPHP_CORE_PATH.'DB' .PATH_SEPARATOR
.ONPHP_CORE_PATH.'DB'.DIRECTORY_SEPARATOR.'Transaction'.PATH_SEPARATOR
.ONPHP_CORE_PATH.'Exceptions' .PATH_SEPARATOR
.ONPHP_CORE_PATH.'Form' .PATH_SEPARATOR
.ONPHP_CORE_PATH.'Form'.DIRECTORY_SEPARATOR.'Filters'.PATH_SEPARATOR
.ONPHP_CORE_PATH.'Form'.DIRECTORY_SEPARATOR.'Primitives'.PATH_SEPARATOR
.ONPHP_CORE_PATH.'Logic' .PATH_SEPARATOR
.ONPHP_CORE_PATH.'OSQL' .PATH_SEPARATOR
.ONPHP_CORE_PATH.'NoSQL' .PATH_SEPARATOR
// main framework
.ONPHP_MAIN_PATH.'Base' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Criteria' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Criteria'.DIRECTORY_SEPARATOR.'Projections'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Crypto' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'DAOs' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'DAOs'.DIRECTORY_SEPARATOR.'Handlers'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'DAOs'.DIRECTORY_SEPARATOR.'Workers'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'DAOs'.DIRECTORY_SEPARATOR.'Interfaces'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Flow' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'SPL' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Net' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Net'.DIRECTORY_SEPARATOR.'Http'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Net'.DIRECTORY_SEPARATOR.'Mail'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Net'.DIRECTORY_SEPARATOR.'Ip'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Net'.DIRECTORY_SEPARATOR.'Soap'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Math' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Markup' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Markup'.DIRECTORY_SEPARATOR.'Feed'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Markup'.DIRECTORY_SEPARATOR.'Html'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'OQL' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'OQL'.DIRECTORY_SEPARATOR.'Expressions'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'OQL'.DIRECTORY_SEPARATOR.'Parsers'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'OQL'.DIRECTORY_SEPARATOR.'Statements'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'OpenId' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'EntityProto'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'EntityProto'.DIRECTORY_SEPARATOR.'Builders'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'EntityProto'.DIRECTORY_SEPARATOR.'Accessors'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'UnifiedContainer'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'UI'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'UI'.DIRECTORY_SEPARATOR.'View'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'UI'.DIRECTORY_SEPARATOR.'Widget'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'TuringTest'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'Archivers'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'IO'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'Logging'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'Mobile'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'Storage'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'Storage'.DIRECTORY_SEPARATOR.'Engines'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'CommandLine'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'Routers'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'Translation'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'AMQP'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'AMQP'
.DIRECTORY_SEPARATOR.'Pecl'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Utils'.DIRECTORY_SEPARATOR.'AMQP'
.DIRECTORY_SEPARATOR.'Exceptions'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Messages' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Messages'.DIRECTORY_SEPARATOR.'Interface'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Application' .PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Charts'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Charts'.DIRECTORY_SEPARATOR.'Google'.PATH_SEPARATOR
.ONPHP_MAIN_PATH.'Monitoring'.PATH_SEPARATOR
.ONPHP_LIB_PATH.'FirePHP'.PATH_SEPARATOR
.ONPHP_META_CLASSES.PATH_SEPARATOR
/*
.ONPHP_INCUBATOR_PATH
.'classes'.DIRECTORY_SEPARATOR
.'Application'.DIRECTORY_SEPARATOR.PATH_SEPARATOR
.ONPHP_INCUBATOR_PATH
.'classes'.DIRECTORY_SEPARATOR
.'Application'.DIRECTORY_SEPARATOR
.'Markups'.DIRECTORY_SEPARATOR.PATH_SEPARATOR
.ONPHP_INCUBATOR_PATH
.'classes'.DIRECTORY_SEPARATOR
.'Application'.DIRECTORY_SEPARATOR
.'Markups'.DIRECTORY_SEPARATOR
.'Documents'.DIRECTORY_SEPARATOR.PATH_SEPARATOR
*/
);
//NOTE: disable by default
//see http://pgfoundry.org/docman/view.php/1000079/117/README.txt
//define('POSTGRES_IP4_ENABLED', true);