Index: trunk/core/kernel/processors/tag_processor.php
===================================================================
diff -u -r2348 -r2566
--- trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 2348)
+++ trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 2566)
@@ -69,7 +69,7 @@
$params['PrefixSpecial'] = $prefix;
return $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix);
}
- trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag.'', E_USER_WARNING);
+ trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag.'', E_USER_WARNING);
}
trigger_error('Tag Undefined:
'.$tag.'',E_USER_WARNING);
return false;
Index: trunk/core/kernel/startup.php
===================================================================
diff -u -r2532 -r2566
--- trunk/core/kernel/startup.php (.../startup.php) (revision 2532)
+++ trunk/core/kernel/startup.php (.../startup.php) (revision 2566)
@@ -29,14 +29,8 @@
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 ) 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);
@@ -49,7 +43,8 @@
$vars = parse_portal_ini(FULL_PATH.'/config.php');
-if ($vars === false) {
+if($vars === false)
+{
global $rootURL;
echo 'In-Portal is probably not installed, or configuration file is missing.
';
echo 'Please use the installation script to fix the problem.
';
@@ -109,10 +104,9 @@
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');
+//safeDefine('LOGIN_CONTROLLER', 'LoginController');
+//safeDefine('USER_MODEL', 'User');
-
// global constants
define('HAVING_FILTER', 1);
define('WHERE_FILTER', 2);
Index: trunk/core/kernel/application.php
===================================================================
diff -u -r2556 -r2566
--- trunk/core/kernel/application.php (.../application.php) (revision 2556)
+++ trunk/core/kernel/application.php (.../application.php) (revision 2566)
@@ -116,12 +116,18 @@
{
if($this->InitDone) return false;
- if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) {
- global $debugger;
- $debugger->appendMemoryUsage('Application before Init:');
+ if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
+ {
+ $GLOBALS['debugger']->appendMemoryUsage('Application before Init:');
}
- if( !$this->isDebugMode() ) set_error_handler( Array(&$this,'handleError') );
+ if( !$this->isDebugMode() )
+ {
+ error_reporting(0);
+ ini_set('display_errors', 0);
+
+ set_error_handler( Array(&$this,'handleError') );
+ }
$this->DB = new kDBConnection(SQL_TYPE, Array(&$this,'handleSQLError') );
$this->DB->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB);
@@ -164,11 +170,11 @@
if( $this->isDebugMode() )
{
- global $debugger;
- $debugger->profileFinish('kernel4_startup');
+ $GLOBALS['debugger']->profileFinish('kernel4_startup');
}
- if(defined('CMS') && CMS==1 && !$this->GetVar('admin') && !$this->IsAdmin() ){
+ if( defined('CMS') && CMS == 1 && !$this->GetVar('admin') && !$this->IsAdmin() )
+ {
define('MOD_REWRITE', 1);
}
@@ -269,7 +275,7 @@
$this->registerClass('kCurrencyRates',MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php');
}
- $this->registerClass('FCKeditor', DOC_ROOT.BASE_PATH.'/'.ADMIN_DIR.'/editor/cmseditor/fckeditor.php');
+ $this->registerClass('FCKeditor', DOC_ROOT.BASE_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this?
/*$this->RegisterClass('LoginController', KERNEL_PATH.'/users/login_controller.php');*/
}
@@ -333,9 +339,9 @@
*/
function Run()
{
- if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) {
- global $debugger;
- $debugger->appendMemoryUsage('Application before Run:');
+ if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
+ {
+ $GLOBALS['debugger']->appendMemoryUsage('Application before Run:');
}
if (!$this->RequestProcessed) $this->ProcessRequest();
@@ -357,16 +363,16 @@
}
}
- if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) {
- global $debugger;
- $debugger->appendMemoryUsage('Application before Parsing:');
+ if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
+ {
+ $GLOBALS['debugger']->appendMemoryUsage('Application before Parsing:');
}
$this->HTML = $this->Parser->Parse( $template_cache->GetTemplateBody($t), $t );
- if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) {
- global $debugger;
- $debugger->appendMemoryUsage('Application after Parsing:');
+ if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
+ {
+ $GLOBALS['debugger']->appendMemoryUsage('Application after Parsing:');
}
}
@@ -384,12 +390,13 @@
*/
function Done()
{
- if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) {
- global $debugger;
- $debugger->appendMemoryUsage('Application before Done:');
+ if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
+ {
+ $GLOBALS['debugger']->appendMemoryUsage('Application before Done:');
}
- if ($this->GetVar('admin')) {
+ if( $this->GetVar('admin') )
+ {
$reg = '/('.preg_quote(BASE_PATH, '/').'.*\.html)(#.*){0,1}(")/sU';
$this->HTML = preg_replace($reg, "$1?admin=1$2$3", $this->HTML);
}
@@ -1139,7 +1146,8 @@
*/
function handleError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
- if (defined('SILENT_LOG') && SILENT_LOG) {
+ if( defined('SILENT_LOG') && SILENT_LOG )
+ {
$fp = fopen(DOC_ROOT.BASE_PATH.'/silent_log.txt','a');
$time = date('d/m/Y H:i:s');
fwrite($fp, '['.$time.'] #'.$errno.': '.strip_tags($errstr).' in ['.$errfile.'] on line '.$errline."\n");
Index: trunk/admin/tree/tree.php
===================================================================
diff -u -r2536 -r2566
--- trunk/admin/tree/tree.php (.../tree.php) (revision 2536)
+++ trunk/admin/tree/tree.php (.../tree.php) (revision 2566)
@@ -1,4 +1,6 @@
Parser->AppendCode($tag->GetCode());
+ if ($tag->Tag != 'block' && $tag->Tag != 'DefineElement') {
+ $this->Parser->AppendCode($tag->GetCode());
+ }
// $this->Parser->AppendCompiledCode( $tag->GetCode() );
}
}
@@ -205,6 +207,15 @@
array_unshift($code, '$o = \'\';');
array_unshift($code, '$application =& kApplication::Instance();');
array_unshift($code, 'extract($params);');
+
+ $defaults = '$defaults = Array(';
+ foreach ($this->NP as $name => $val) {
+ if ($name == 'name') continue;
+ $defaults .= '"'.$name.'" => "'.str_replace('"', '\"', $val).'",';
+ }
+ $defaults .= ');';
+ array_unshift($code, '$params = array_merge_recursive2($defaults, $params);');
+ array_unshift($code, $defaults);
$code[] = 'return $o;';
@@ -241,7 +252,7 @@
else {
// append the tag itself to the block - while in block, we check every tag to be 'blockend'
// if it is not - we need to append the tag to the buffer, which we'll parse later in 'parse_block'
- if ($tag->Tag != 'block') {
+ //if ($tag->Tag != 'block') {
if (defined('EXPERIMENTAL_PRE_PARSE') && isset($this->Application->PreParsedBlocks[$this->BlockName])) {
return;
}
@@ -251,7 +262,7 @@
else {
$this->Parser->AppendOutput($tag->GetFullTag());
}
- }
+ //}
return false;
}
}
Index: trunk/core/kernel/parser/template_parser.php
===================================================================
diff -u -r1848 -r2566
--- trunk/core/kernel/parser/template_parser.php (.../template_parser.php) (revision 1848)
+++ trunk/core/kernel/parser/template_parser.php (.../template_parser.php) (revision 2566)
@@ -422,10 +422,10 @@
$debugger->appendHTML('ParseBlock '.$params['name'].' pass_params is '.$params['pass_params'].' force is '.$force_pass_params.' in '.$debugger->getFileLink($debugger->getLocalFile(DOC_ROOT.BASE_PATH.THEMES_PATH.'/'.$this->TemplateName).'.tpl', $this->CurrentLineNumber(), '', true));
}
- if ( $this->Application->isDebugMode() && dbg_ConstOn('DBG_PRE_PARSE') ) {
+ /*if ( $this->Application->isDebugMode() && dbg_ConstOn('DBG_PRE_PARSE') ) {
global $debugger;
$debugger->CurrentPreParsedBlock = $params['name'];
- }
+ }*/
if (defined('EXPERIMENTAL_PRE_PARSE')) {
$this->MainParser = false;
if (isset($this->Application->PreParsedBlocks[$params['name']]) ) {
Index: trunk/core/kernel/utility/debugger.php
===================================================================
diff -u -r2363 -r2566
--- trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 2363)
+++ trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 2566)
@@ -31,7 +31,6 @@
'DBG_USE_HIGHLIGHT'=>1,
'DBG_USE_SHUTDOWN_FUNC'=>DBG_ZEND_PRESENT?0:1,
'DBG_HANDLE_ERRORS'=>DBG_ZEND_PRESENT?0:1,
- 'DBG_SHOW_MEMORY_USAGE'=>1,
'DBG_IGNORE_STRICT_ERRORS'=>1,
'DBG_DOMVIEWER'=>'/temp/domviewer.html',
'DOC_ROOT'=> str_replace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT']) ), // windows hack
@@ -797,22 +796,28 @@
}
memoryUsage['debugger_finish']=memory_get_usage();
- $this->memoryUsage['print_report']=$this->memoryUsage['debugger_finish']-$this->memoryUsage['debugger_start'];
- $this->memoryUsage['total']=$this->memoryUsage['print_report']+$this->memoryUsage['error_handling'];
- $this->memoryUsage['application']=memory_get_usage()-$this->memoryUsage['total'];
- if($returnResult)
- {
- $ret = ob_get_contents();
- ob_clean();
- if( dbg_ConstOn('DBG_SHOW_MEMORY_USAGE') ) $ret.=$this->getMemoryUsageReport();
- return $ret;
- }
- else
- {
- ob_end_flush();
- if( dbg_ConstOn('DBG_SHOW_MEMORY_USAGE') ) echo $this->getMemoryUsageReport();
- }
+
+ dbg_safeDefine('DBG_SHOW_MEMORY_USAGE', 1);
+ if( dbg_ConstOn('DBG_SHOW_MEMORY_USAGE') )
+ {
+ $this->memoryUsage['debugger_finish']=memory_get_usage();
+ $this->memoryUsage['print_report']=$this->memoryUsage['debugger_finish']-$this->memoryUsage['debugger_start'];
+ $this->memoryUsage['total']=$this->memoryUsage['print_report']+$this->memoryUsage['error_handling'];
+ $this->memoryUsage['application']=memory_get_usage()-$this->memoryUsage['total'];
+ }
+
+ if($returnResult)
+ {
+ $ret = ob_get_contents();
+ ob_clean();
+ if( dbg_ConstOn('DBG_SHOW_MEMORY_USAGE') ) $ret .= $this->getMemoryUsageReport();
+ return $ret;
+ }
+ else
+ {
+ ob_end_flush();
+ if( dbg_ConstOn('DBG_SHOW_MEMORY_USAGE') ) echo $this->getMemoryUsageReport();
+ }
}
/**
@@ -823,7 +828,9 @@
*/
function getMemoryUsageReport()
{
- $info=Array('printReport'=>'print_report',
+ if( !dbg_ConstOn('DBG_SHOW_MEMORY_USAGE') ) return '';
+
+ $info = Array('printReport'=>'print_report',
'saveError'=>'error_handling',
'Total'=>'total',
'Application'=>'application');
@@ -872,10 +879,10 @@
/*in /www/kostja/in-commerce4/kernel/kernel4/parser/construct_tags.php(177) : runtime-created function on line
[PRE-PARSED block, $line 13]: Undefined variable: IdField*/
-
+ /*
if( strpos($errfile,'runtime-created') !== false ) {
$errfile = ' PRE-PARSED block '.$this->CurrentPreParsedBlock.' ';
- }
+ }*/
if( strpos($errfile,'eval()\'d code') !== false )
{
Index: trunk/kernel/admin_templates/incs/grid_blocks.tpl
===================================================================
diff -u -r2334 -r2566
--- trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 2334)
+++ trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 2566)
@@ -76,7 +76,7 @@