Index: branches/5.2.x/core/kernel/nparser/compiler.php =================================================================== diff -u -N -r13840 -r14095 --- branches/5.2.x/core/kernel/nparser/compiler.php (.../compiler.php) (revision 13840) +++ branches/5.2.x/core/kernel/nparser/compiler.php (.../compiler.php) (revision 14095) @@ -1,6 +1,6 @@ Errors = unserialize($errors); } - $save_handler = $this->Application->errorHandlers[0]; - $this->Application->errorHandlers[0] = array(&$this, 'SaveError'); + kUtil::safeDefine('DBG_NPARSER_FORCE_COMPILE', 1); - safeDefine('DBG_NPARSER_FORCE_COMPILE', 1); - safeDefine('DBG_IGNORE_FATAL_ERRORS', 1); - $i = $current; $this->Application->InitParser(true); while ($i < $total && $i < ($current + 20)) { $a_template = $templates[$i]; - $this->Application->Parser->CheckTemplate($a_template['module'] . '/' . $a_template['path']); + try { + $this->Application->Parser->CheckTemplate($a_template['module'] . '/' . $a_template['path']); + } + catch (ParserException $e) { + $this->Errors[] = Array ('msg' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()); + } + $i++; } - $this->Application->errorHandlers[0] = $save_handler; - $this->Application->StoreVar('current_template_to_compile', $i); $this->Application->StoreVar('templates_to_compile', serialize($templates)); $this->Application->StoreVar('compile_errors', serialize($this->Errors)); $res = floor(($current / $total) * 100); + if ($res == 100 || $current >= $total) { $this->Application->RemoveVar('templates_to_compile'); $this->Application->RemoveVar('current_template_to_compile'); @@ -66,16 +67,6 @@ echo $res; } - function SaveError($errno, $errstr, $errfile, $errline, $errcontext) - { - if (defined('E_STRICT') && ($errno == E_STRICT)) { - return true; - } - - $this->Errors[] = Array ('msg' => $errstr, 'file' => $errfile, 'line' => $errline); - return true; - } - function FindTemplates() { $this->Templates = Array ();