Index: branches/RC/core/kernel/startup.php
===================================================================
diff -u -N -r10098 -r10832
--- branches/RC/core/kernel/startup.php (.../startup.php) (revision 10098)
+++ branches/RC/core/kernel/startup.php (.../startup.php) (revision 10832)
@@ -1,7 +1,7 @@
Don\'t forget to clean Cache table afterwards');
+ define('KERNEL_PATH', FULL_PATH . '/core/kernel');
+ if (file_exists(FULL_PATH . '/kernel/kernel4/application.php')) {
+ die('Please remove ' . FULL_PATH . '/kernel/kernel4 directiry - it has been moved to ' . KERNEL_PATH . '
Don\'t forget to clean Cache table afterwards');
}
if (!function_exists('getmicrotime')) {
@@ -12,29 +12,29 @@
}
}
$globals_start = getmicrotime();
- include_once(KERNEL_PATH.'/globals.php'); // non OOP functions used through kernel, e.g. print_pre
- include_once(KERNEL_PATH.'/utility/multibyte.php'); // emulating multi-byte php extension
+ include_once(KERNEL_PATH . '/globals.php'); // non OOP functions used through kernel, e.g. print_pre
+ include_once(KERNEL_PATH . '/utility/multibyte.php'); // emulating multi-byte php extension
$globals_end = getmicrotime();
define('INPORTAL_ENV', 1);
- $vars = parse_portal_ini(FULL_PATH.'/config.php');
+ $vars = parse_portal_ini(FULL_PATH . '/config.php');
$admin_directory = isset($vars['AdminDirectory']) ? $vars['AdminDirectory'] : '/admin';
safeDefine('ADMIN_DIRECTORY', $admin_directory);
# New path detection method: begin
if (defined('REL_PATH')) {
// location of index.php relatively to site base folder
- $relative_path = preg_replace('/^[\/]{0,1}admin(.*)/', $admin_directory.'\\1', REL_PATH);
+ $relative_path = preg_replace('/^[\/]{0,1}admin(.*)/', $admin_directory . '\\1', REL_PATH);
}
else {
// default index.php relative location is administrative console folder
define('REL_PATH', $admin_directory);
$relative_path = REL_PATH;
}
- $ps = rtrim(preg_replace('/'.preg_quote(rtrim($relative_path, '/'), '/').'$/', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/');
+ $ps = rtrim(preg_replace('/' . preg_quote(rtrim($relative_path, '/'), '/') . '$/', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/');
safeDefine('BASE_PATH', $ps); // in case in-portal has defined it before
# New path detection method: end
@@ -48,16 +48,16 @@
safeDefine('APPLICATION_PATH', isset($vars['ApplicationPath']) ? $vars['ApplicationPath'] : '/core/kernel/application.php');
if (isset($vars['WriteablePath'])) {
- define('WRITEABLE', FULL_PATH.$vars['WriteablePath']);
+ define('WRITEABLE', FULL_PATH . $vars['WriteablePath']);
define('WRITEBALE_BASE', $vars['WriteablePath']);
}
if ($vars === false || count($vars) == 0) {
global $rootURL;
echo 'In-Portal is probably not installed, or configuration file is missing.
';
echo 'Please use the installation script to fix the problem.
';
- $install_script = file_exists(FULL_PATH.'/proj-base/install.php') ? 'core' : 'admin';
- echo 'Go to installation script
';
+ $install_script = file_exists(FULL_PATH . '/proj-base/install.php') ? 'core' : 'admin';
+ echo 'Go to installation script
';
flush();
exit;
}
@@ -74,20 +74,22 @@
}
define('TABLE_PREFIX', $vars['TablePrefix']);
-
define('DOMAIN', getArrayValue($vars, 'Domain'));
ini_set('memory_limit', '50M');
define('MODULES_PATH', FULL_PATH);
- define('EXPORT_PATH', defined('WRITEABLE') ? WRITEABLE.'/export' : FULL_PATH.ADMIN_DIRECTORY.'/export');
- define('GW_CLASS_PATH', MODULES_PATH.'/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path
- define('SYNC_CLASS_PATH', FULL_PATH.'/sync'); // path for 3rd party user syncronization scripts
+ define('EXPORT_BASE_PATH', (defined('WRITEBALE_BASE') ? WRITEBALE_BASE : ADMIN_DIRECTORY) . '/export');
+ define('EXPORT_PATH', FULL_PATH . EXPORT_BASE_PATH);
+
+ define('GW_CLASS_PATH', MODULES_PATH . '/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path
+ define('SYNC_CLASS_PATH', FULL_PATH . '/sync'); // path for 3rd party user syncronization scripts
+
safeDefine('ENV_VAR_NAME','env');
- safeDefine('IMAGES_PATH', '/kernel/images/');
- safeDefine('IMAGES_PENDING_PATH', IMAGES_PATH.'pending/');
+ safeDefine('IMAGES_PATH', (defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . '/images/');
+ safeDefine('IMAGES_PENDING_PATH', IMAGES_PATH . 'pending/');
safeDefine('CUSTOM_UPLOAD_PATH', '/templates/images/custom/');
safeDefine('MAX_UPLOAD_SIZE', min(ini_get('upload_max_filesize'), ini_get('post_max_size'))*1024*1024);
@@ -96,37 +98,37 @@
safeDefine('EXPERIMENTAL_PRE_PARSE', 1);
safeDefine('SILENT_LOG', 0);
- if( file_exists(FULL_PATH.'/debug.php') )
+ if( file_exists(FULL_PATH . '/debug.php') )
{
- include_once(FULL_PATH.'/debug.php');
+ include_once(FULL_PATH . '/debug.php');
if(isset($dbg_options['DEBUG_MODE']) && $dbg_options['DEBUG_MODE']) {
$debugger_start = getmicrotime();
- include_once(KERNEL_PATH.'/utility/debugger.php');
+ include_once(KERNEL_PATH . '/utility/debugger.php');
$debugger_end = getmicrotime();
if (isset($debugger) && constOn('DBG_PROFILE_INCLUDES')) {
- $debugger->profileStart('inc_globals', KERNEL_PATH.'/globals.php', $globals_start);
- $debugger->profileFinish('inc_globals', KERNEL_PATH.'/globals.php', $globals_end);
+ $debugger->profileStart('inc_globals', KERNEL_PATH . '/globals.php', $globals_start);
+ $debugger->profileFinish('inc_globals', KERNEL_PATH . '/globals.php', $globals_end);
$debugger->profilerAddTotal('includes', 'inc_globals');
- $debugger->profileStart('inc_debugger', KERNEL_PATH.'/utility/debugger.php', $debugger_start);
- $debugger->profileFinish('inc_debugger', KERNEL_PATH.'/utility/debugger.php', $debugger_end);
+ $debugger->profileStart('inc_debugger', KERNEL_PATH . '/utility/debugger.php', $debugger_start);
+ $debugger->profileFinish('inc_debugger', KERNEL_PATH . '/utility/debugger.php', $debugger_end);
$debugger->profilerAddTotal('includes', 'inc_debugger');
}
}
}
$includes = Array(
- KERNEL_PATH.'/application.php',
- FULL_PATH.APPLICATION_PATH,
- KERNEL_PATH.'/db/db_connection.php',
- KERNEL_PATH."/kbase.php",
- KERNEL_PATH.'/utility/event.php',
- KERNEL_PATH."/utility/factory.php",
- KERNEL_PATH."/languages/phrases_cache.php",
- KERNEL_PATH."/db/dblist.php",
- KERNEL_PATH."/db/dbitem.php",
- KERNEL_PATH."/event_handler.php",
- KERNEL_PATH.'/db/db_event_handler.php',
+ KERNEL_PATH . '/application.php',
+ FULL_PATH . APPLICATION_PATH,
+ KERNEL_PATH . '/db/db_connection.php',
+ KERNEL_PATH . "/kbase.php",
+ KERNEL_PATH . '/utility/event.php',
+ KERNEL_PATH . "/utility/factory.php",
+ KERNEL_PATH . "/languages/phrases_cache.php",
+ KERNEL_PATH . "/db/dblist.php",
+ KERNEL_PATH . "/db/dbitem.php",
+ KERNEL_PATH . "/event_handler.php",
+ KERNEL_PATH . '/db/db_event_handler.php',
);
foreach ($includes as $a_file) {
@@ -137,9 +139,9 @@
$debugger->AttachToApplication();
}
- if( !function_exists('adodb_mktime') ) include_once(KERNEL_PATH.'/utility/adodb-time.inc.php');
+ if( !function_exists('adodb_mktime') ) include_once(KERNEL_PATH . '/utility/adodb-time.inc.php');
-// include_once(KERNEL_PATH."/utility/temp_handler.php"); // needed because of static calls from kBase
+// include_once(KERNEL_PATH . '/utility/temp_handler.php'); // needed because of static calls from kBase
// up to here
// global constants