Revision 1887
Added by Dietmar over 11 years ago
initialize.php | ||
---|---|---|
78 | 78 |
$x1 = parse_url(WB_URL); |
79 | 79 |
define('WB_REL', (isset($x1['path']) ? $x1['path'] : '')); |
80 | 80 |
} |
81 |
define('ADMIN_REL', WB_REL.'/'.ADMIN_DIRECTORY);
|
|
81 |
if(!defined('ADMIN_REL')){ define('ADMIN_REL', WB_REL.'/'.ADMIN_DIRECTORY); }
|
|
82 | 82 |
if(!defined('DOCUMENT_ROOT')) { |
83 | 83 |
|
84 | 84 |
define('DOCUMENT_ROOT', preg_replace('/'.preg_quote(WB_REL, '/').'$/', '', WB_PATH)); |
85 | 85 |
} |
86 |
define('TMP_PATH', WB_PATH.'/temp');
|
|
86 |
if(!defined('TMP_PATH')){ define('TMP_PATH', WB_PATH.'/temp'); }
|
|
87 | 87 |
} |
88 | 88 |
/** |
89 | 89 |
* Read DB settings from configuration file |
... | ... | |
117 | 117 |
switch($key): |
118 | 118 |
case 'DEBUG': |
119 | 119 |
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN); |
120 |
if(!defined('DEBUG')) { define('DEBUG', $value); } |
|
120 | 121 |
break; |
121 | 122 |
case 'WB_URL': |
122 | 123 |
case 'AppUrl': |
... | ... | |
143 | 144 |
$db['name'] = isset($db['name']) ? $db['name'] : 'dummy'; |
144 | 145 |
$db['charset'] = isset($db['charset']) ? $db['charset'] : 'utf8'; |
145 | 146 |
$db['table_prefix'] = (isset($db['table_prefix']) ? $db['table_prefix'] : ''); |
146 |
define('TABLE_PREFIX', $db['table_prefix']);
|
|
147 |
if(!defined('TABLE_PREFIX')) { define('TABLE_PREFIX', $db['table_prefix']); }
|
|
147 | 148 |
if($sRetvalType == 'dsn') { |
148 | 149 |
$aRetval[0] = $db['type'].':dbname='.$db['name'].';host='.$db['host'].';' |
149 | 150 |
. ($db['port'] != '' ? 'port='.(int)$db['port'].';' : ''); |
... | ... | |
232 | 233 |
switch($sSettingName): |
233 | 234 |
case 'STRING_FILE_MODE': |
234 | 235 |
$iTmp = ((intval(octdec($aSetting['value'])) & ~0111)|0600); |
235 |
define('OCTAL_FILE_MODE', $iTmp);
|
|
236 |
define('STRING_FILE_MODE', sprintf('0%03o', $iTmp));
|
|
236 |
if(!defined('OCTAL_FILE_MODE')) { define('OCTAL_FILE_MODE', $iTmp); }
|
|
237 |
if(!defined('STRING_FILE_MODE')) { define('STRING_FILE_MODE', sprintf('0%03o', $iTmp)); }
|
|
237 | 238 |
break; |
238 | 239 |
case 'STRING_DIR_MODE': |
239 | 240 |
$iTmp = (intval(octdec($aSetting['value'])) |0711); |
240 |
define('OCTAL_DIR_MODE', $iTmp);
|
|
241 |
define('STRING_DIR_MODE', sprintf('0%03o', $iTmp));
|
|
241 |
if(!defined('OCTAL_DIR_MODE')) { define('OCTAL_DIR_MODE', $iTmp); }
|
|
242 |
if(!defined('STRING_DIR_MODE')) { define('STRING_DIR_MODE', sprintf('0%03o', $iTmp)); }
|
|
242 | 243 |
break; |
243 | 244 |
case 'PAGES_DIRECTORY': |
244 | 245 |
// sanitize pages_directory |
245 | 246 |
$sTmp = trim($aSetting['value'], '/'); |
246 | 247 |
$sTmp = ($sTmp == '' ? '' : '/'.$sTmp); |
247 |
define('PAGES_DIRECTORY', $sTmp);
|
|
248 |
if(!defined('PAGES_DIRECTORY')) { define('PAGES_DIRECTORY', $sTmp); }
|
|
248 | 249 |
break; |
249 | 250 |
default: // make global const from setting |
250 |
@define($sSettingName, $aSetting['value']);
|
|
251 |
if(!defined($sSettingName)) { define($sSettingName, $aSetting['value']); }
|
|
251 | 252 |
break; |
252 | 253 |
endswitch; |
253 | 254 |
} |
... | ... | |
266 | 267 |
define('SESSION_STARTED', true); |
267 | 268 |
} |
268 | 269 |
// get/set users timezone --- |
269 |
define('TIMEZONE', (isset($_SESSION['TIMEZONE']) ? $_SESSION['TIMEZONE'] : DEFAULT_TIMEZONE));
|
|
270 |
define('DATE_FORMAT', (isset($_SESSION['DATE_FORMAT']) ? $_SESSION['DATE_FORMAT'] : DEFAULT_DATE_FORMAT));
|
|
271 |
define('TIME_FORMAT', (isset($_SESSION['TIME_FORMAT']) ? $_SESSION['TIME_FORMAT'] : DEFAULT_TIME_FORMAT));
|
|
270 |
if(!defined('TIMEZONE')) { define('TIMEZONE', (isset($_SESSION['TIMEZONE']) ? $_SESSION['TIMEZONE'] : DEFAULT_TIMEZONE)); }
|
|
271 |
if(!defined('DATE_FORMAT')) { define('DATE_FORMAT', (isset($_SESSION['DATE_FORMAT']) ? $_SESSION['DATE_FORMAT'] : DEFAULT_DATE_FORMAT)); }
|
|
272 |
if(!defined('TIME_FORMAT')) { define('TIME_FORMAT', (isset($_SESSION['TIME_FORMAT']) ? $_SESSION['TIME_FORMAT'] : DEFAULT_TIME_FORMAT)); }
|
|
272 | 273 |
// set Theme directory --- |
273 |
define('THEME_URL', WB_URL.'/templates/'.DEFAULT_THEME);
|
|
274 |
define('THEME_PATH', WB_PATH.'/templates/'.DEFAULT_THEME);
|
|
275 |
define('THEME_REL', WB_REL.'/templates/'.DEFAULT_THEME);
|
|
274 |
if(!defined('THEMA_URL')) { define('THEME_URL', WB_URL.'/templates/'.DEFAULT_THEME); }
|
|
275 |
if(!defined('THEME_PATH')) { define('THEME_PATH', WB_PATH.'/templates/'.DEFAULT_THEME); }
|
|
276 |
if(!defined('THEME_REL')) { define('THEME_REL', WB_REL.'/templates/'.DEFAULT_THEME); }
|
|
276 | 277 |
// extended wb editor settings |
277 |
define('EDIT_ONE_SECTION', false);
|
|
278 |
define('EDITOR_WIDTH', 0);
|
|
278 |
if(!defined('EDIT_ONE_SECTION')) { define('EDIT_ONE_SECTION', false); }
|
|
279 |
if(!defined('EDITOR_WIDTH')) { define('EDITOR_WIDTH', 0); }
|
|
279 | 280 |
// define form security class and preload it --- |
280 | 281 |
$sSecMod = (defined('SECURE_FORM_MODULE') && SECURE_FORM_MODULE != '') ? '.'.SECURE_FORM_MODULE : ''; |
281 | 282 |
$sSecMod = WB_PATH.'/framework/SecureForm'.$sSecMod.'.php'; |
282 | 283 |
require_once($sSecMod); |
283 | 284 |
// *** begin deprecated part ************************************************************* |
284 | 285 |
// load settings for use in Captch and ASP module |
285 |
if (!defined("WB_INSTALL_PROCESS")) {
|
|
286 |
if (!defined('WB_INSTALL_PROCESS') && !defined('ENABLED_CAPTCHA')) {
|
|
286 | 287 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'mod_captcha_control`'; |
287 | 288 |
// request settings from database |
288 | 289 |
if(($oSettings = $database->query($sql))) { |
Also available in: Unified diff
! update WbDatabase SqlImport parameter,