mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- improvement added patch for additional SmartyCompilerException properties for better access to scource information (forum topic 24559)
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== trunk =====
|
===== trunk =====
|
||||||
|
17.09.2013
|
||||||
|
- improvement added patch for additional SmartyCompilerException properties for better access to scource information (forum topic 24559)
|
||||||
|
|
||||||
16.09.2013
|
16.09.2013
|
||||||
- bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320)
|
- bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320)
|
||||||
|
|
||||||
|
@@ -1528,7 +1528,26 @@ class SmartyCompilerException extends SmartyException
|
|||||||
{
|
{
|
||||||
return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
|
return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* The line number of the template error
|
||||||
|
* @type int|null
|
||||||
|
*/
|
||||||
|
public $line = null;
|
||||||
|
/**
|
||||||
|
* The template source snippet relating to the error
|
||||||
|
* @type string|null
|
||||||
|
*/
|
||||||
|
public $source = null;
|
||||||
|
/**
|
||||||
|
* The raw text of the error message
|
||||||
|
* @type string|null
|
||||||
|
*/
|
||||||
|
public $desc = null;
|
||||||
|
/**
|
||||||
|
* The resource identifier or template name
|
||||||
|
* @type string|null
|
||||||
|
*/
|
||||||
|
public $template = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -798,7 +798,12 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
$error_text .= ', expected one of: ' . implode(' , ', $expect);
|
$error_text .= ', expected one of: ' . implode(' , ', $expect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new SmartyCompilerException($error_text);
|
$e = new SmartyCompilerException($error_text);
|
||||||
|
$e->line = $line;
|
||||||
|
$e->source = trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1]));
|
||||||
|
$e->desc = $args;
|
||||||
|
$e->template = $this->template->source->filepath;
|
||||||
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user