Index: trunk/core/kernel/startup.php
===================================================================
--- trunk/core/kernel/startup.php	(revision 2531)
+++ trunk/core/kernel/startup.php	(revision 2532)
@@ -1,122 +1,127 @@
 <?php
-error_reporting(0);
-ini_set('display_errors',1);
-
 define('KERNEL_PATH', FULL_PATH.'/kernel/kernel4');
 
-if (defined('ADMIN') && ADMIN) {
+if( defined('ADMIN') && ADMIN )
+{
 	define('SPECIAL_TEMPLATES_FOLDER', '/kernel/admin_templates');
 }
 
 define('INPORTAL_ENV', 1);
 
-if (!isset($_SERVER['DOCUMENT_ROOT']) || !$_SERVER['DOCUMENT_ROOT']) {
+if( !isset($_SERVER['DOCUMENT_ROOT']) || !$_SERVER['DOCUMENT_ROOT'] )
+{
 	$full_path = str_replace('\\', '/', dirname(FULL_PATH));
 	if (!isset($_SERVER['PATH_INFO'])) {
 		$_SERVER['PATH_INFO'] = $_SERVER['PHP_SELF'];
 	}
 	$path_info = str_replace('\\', '/', dirname($_SERVER['PATH_INFO']));
 
 //	echo "replacing ".$path_info.' (path_info) with "" in '.$full_path.' (full_path) = '.str_replace($path_info, '', $full_path).'<br>';
 	$_SERVER['DOCUMENT_ROOT'] = str_replace($path_info, '', $full_path);
 }
 
 $doc_root = rtrim(realpath($_SERVER['DOCUMENT_ROOT']), '/');
 $doc_root = str_replace('\\', '/', $doc_root); // windows hack
 define('DOC_ROOT', $doc_root);
 
 include_once(KERNEL_PATH.'/globals.php');	// non OOP functions used through kernel, e.g. print_pre
 
 if( file_exists(FULL_PATH.'/debug.php') )
 {
 	k4_include_once(FULL_PATH.'/debug.php');
 	if( defined('DEBUG_MODE')&&DEBUG_MODE ) include_once(KERNEL_PATH.'/utility/debugger.php');
 }
 
+	if( !(defined('DEBUG_MODE') && DEBUG_MODE) )
+	{
+		error_reporting(0);
+		ini_set('display_errors', 1);
+	}
+	
 safeDefine('INPORTAL_TAGS', true);
 
 $reg = '/'.preg_quote (DOC_ROOT, '/').'/i';
 define('BASE_PATH', $base_path = ereg_replace('/admin', '', preg_replace($reg, '', str_replace('\\', '/', FULL_PATH))));
 
 safeDefine( 'SERVER_NAME', $_SERVER['HTTP_HOST']);
 safeDefine( 'KERNEL_PATH', DOC_ROOT.BASE_PATH.'/kernel4');
 safeDefine( 'PROTOCOL', 'http://');
 
 $vars = parse_portal_ini(FULL_PATH.'/config.php');
 
 if ($vars === false) {
 	global $rootURL;
 	echo 'In-Portal is probably not installed, or configuration file is missing.<br>';
 	echo 'Please use the installation script to fix the problem.<br><br>';
 	if ( !preg_match('/admin/', __FILE__) ) $ins = '/admin';
 
 	echo '<a href="'.PROTOCOL.SERVER_NAME.BASE_PATH.$ins.'/install.php">Go to installation script</a><br><br>';
 	flush();
 	exit;
 }
 
 define('SQL_TYPE', $vars['DBType']);
 define('SQL_SERVER', $vars['DBHost']);
 define('SQL_USER', $vars['DBUser']);
 define('SQL_PASS', $vars['DBUserPassword']);
 define('SQL_DB', $vars['DBName']);
 define('TABLE_PREFIX', $vars['TablePrefix']);
 
 ini_set('memory_limit', '50M');
 
 define('MODULES_PATH', DOC_ROOT.BASE_PATH);
 define('EXPORT_PATH', DOC_ROOT.BASE_PATH.'/admin/export');
 define('GW_CLASS_PATH', MODULES_PATH.'/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path
 
 
 safeDefine('ENV_VAR_NAME','env');
 
 k4_include_once(KERNEL_PATH.'/db/db_connection.php');
 
 safeDefine('IMAGES_PATH', '/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);
 
 safeDefine('CACHE_CONFIGS_FILES', 1);
 safeDefine('EXPERIMENTAL_PRE_PARSE', 1);
 safeDefine('SILENT_LOG', 0);
 
 k4_include_once(KERNEL_PATH."/kbase.php");
 k4_include_once(KERNEL_PATH.'/utility/event.php');
 k4_include_once(KERNEL_PATH."/utility/factory.php");
 k4_include_once(KERNEL_PATH."/languages/phrases_cache.php");
 
 // We should get rid of these includes:
 k4_include_once(KERNEL_PATH."/db/dblist.php");
 k4_include_once(KERNEL_PATH."/db/dbitem.php");
 
 k4_include_once(KERNEL_PATH.'/processors/tag_processor.php');
 k4_include_once(KERNEL_PATH."/db/db_tag_processor.php");
 
 k4_include_once(KERNEL_PATH."/event_handler.php");
 
 k4_include_once(KERNEL_PATH.'/db/db_event_handler.php');
 
 k4_include_once(KERNEL_PATH."/utility/temp_handler.php"); // needed because of static calls from kBase
 // up to here
 
 k4_include_once(KERNEL_PATH.'/application.php');
 k4_include_once(MODULES_PATH.'/kernel/units/general/my_application.php');
 
 safeDefine('LOGIN_CONTROLLER', 'LoginController');
 safeDefine('USER_MODEL', 'User');
 
 
 // global constants
 define('HAVING_FILTER', 1);
 define('WHERE_FILTER', 2);
 
 define('FLT_TYPE_AND',	'AND');
 define('FLT_TYPE_OR',	'OR');
 
 safeDefine('STATUS_DISABLED', 0);
 safeDefine('STATUS_ACTIVE', 1);
 safeDefine('STATUS_PENDING', 2);
 
 ?>
\ No newline at end of file

Property changes on: trunk/core/kernel/startup.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16
\ No newline at end of property
+1.17
\ No newline at end of property