ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct ($message, $lineno=-1, $source=null, Exception $previous=null) | |
Constructor. More... | |
getRawMessage () | |
Gets the raw message. More... | |
getTemplateFile () | |
Gets the logical name where the error occurred. More... | |
setTemplateFile ($name) | |
Sets the logical name where the error occurred. More... | |
getTemplateName () | |
Gets the logical name where the error occurred. More... | |
setTemplateName ($name) | |
Sets the logical name where the error occurred. More... | |
getTemplateLine () | |
Gets the template line where the error occurred. More... | |
setTemplateLine ($lineno) | |
Sets the template line where the error occurred. More... | |
getSourceContext () | |
Gets the source context of the Twig template where the error occurred. More... | |
setSourceContext (Twig_Source $source=null) | |
Sets the source context of the Twig template where the error occurred. More... | |
guess () | |
__call ($method, $arguments) | |
For PHP < 5.3.0, provides access to the getPrevious() method. More... | |
appendMessage ($rawMessage) | |
Protected Member Functions | |
updateRepr () | |
guessTemplateInfo () | |
Protected Attributes | |
$lineno | |
$filename | |
$rawMessage | |
$previous | |
Private Attributes | |
$sourcePath | |
$sourceCode | |
Twig base exception.
This exception class and its children must only be used when an error occurs during the loading of a template, when a syntax error is detected in a template, or when rendering a template. Other errors must use regular PHP exception classes (like when the template cache directory is not writable for instance).
To help debugging template issues, this class tracks the original template name and line where the error occurred.
Whenever possible, you must set these information (original template name and line number) yourself by passing them to the constructor. If some or all these information are not available from where you throw the exception, then this class will guess them automatically (when the line number is set to -1 and/or the name is set to null). As this is a costly operation, this can be disabled by passing false for both the name and the line number when creating a new instance of this class.
Twig_Error::__construct | ( | $message, | |
$lineno = -1 , |
|||
$source = null , |
|||
Exception | $previous = null |
||
) |
Constructor.
Set both the line number and the name to false to disable automatic guessing of the original template name and line number.
Set the line number to -1 to enable its automatic guessing. Set the name to null to enable its automatic guessing.
By default, automatic guessing is enabled.
string | $message | The error message |
int | $lineno | The template line where the error occurred |
Twig_Source | string | null | $source | The source context where the error occurred |
Exception | $previous | The previous exception |
Definition at line 62 of file Error.php.
References $lineno, $message, $name, $previous, $source, guessTemplateInfo(), and updateRepr().
Twig_Error::__call | ( | $method, | |
$arguments | |||
) |
For PHP < 5.3.0, provides access to the getPrevious() method.
string | $method | The method name |
array | $arguments | The parameters to be passed to the method |
BadMethodCallException |
Definition at line 228 of file Error.php.
References $previous.
Twig_Error::appendMessage | ( | $rawMessage | ) |
Definition at line 237 of file Error.php.
References $rawMessage, and updateRepr().
Referenced by Twig_Error_Loader\__construct(), Twig_Error_Syntax\addSuggestions(), and Twig_Parser\subparse().
Twig_Error::getRawMessage | ( | ) |
Gets the raw message.
Definition at line 98 of file Error.php.
References $rawMessage.
Twig_Error::getSourceContext | ( | ) |
Gets the source context of the Twig template where the error occurred.
Definition at line 191 of file Error.php.
Referenced by Twig_Template\displayBlock(), Twig_Template\displayWithErrorHandling(), Twig_Template\loadTemplate(), Twig_Parser\parse(), Twig_Tests_ErrorTest\testTwigExceptionAddsFileAndLine(), Twig_Tests_ErrorTest\testTwigExceptionGuessWithExceptionAndArrayLoader(), Twig_Tests_ErrorTest\testTwigExceptionGuessWithExceptionAndFilesystemLoader(), Twig_Tests_ErrorTest\testTwigExceptionGuessWithMissingVarAndArrayLoader(), and Twig_Tests_ErrorTest\testTwigExceptionGuessWithMissingVarAndFilesystemLoader().
Twig_Error::getTemplateFile | ( | ) |
Gets the logical name where the error occurred.
Definition at line 110 of file Error.php.
References $filename.
Twig_Error::getTemplateLine | ( | ) |
Gets the template line where the error occurred.
Definition at line 169 of file Error.php.
References $lineno.
Referenced by Twig_Template\displayBlock(), Twig_Template\displayWithErrorHandling(), Twig_Template\loadTemplate(), Twig_Parser\parse(), Twig_Tests_ErrorTest\testTwigExceptionAddsFileAndLine(), Twig_Tests_ErrorTest\testTwigExceptionGuessWithExceptionAndArrayLoader(), Twig_Tests_ErrorTest\testTwigExceptionGuessWithExceptionAndFilesystemLoader(), Twig_Tests_ErrorTest\testTwigExceptionGuessWithMissingVarAndArrayLoader(), and Twig_Tests_ErrorTest\testTwigExceptionGuessWithMissingVarAndFilesystemLoader().
Twig_Error::getTemplateName | ( | ) |
Gets the logical name where the error occurred.
Definition at line 140 of file Error.php.
References $filename.
Referenced by guessTemplateInfo().
Twig_Error::guess | ( | ) |
Definition at line 212 of file Error.php.
References guessTemplateInfo(), and updateRepr().
Referenced by Twig_Template\displayBlock(), Twig_Template\displayWithErrorHandling(), Twig_Template\getParent(), and Twig_Template\loadTemplate().
|
protected |
Definition at line 294 of file Error.php.
References $exceptions, $r, $template, and getTemplateName().
Referenced by __construct(), and guess().
Twig_Error::setSourceContext | ( | Twig_Source | $source = null | ) |
Sets the source context of the Twig template where the error occurred.
Definition at line 199 of file Error.php.
References $source, and updateRepr().
Referenced by Twig_Environment\compileSource(), Twig_Template\displayBlock(), Twig_Template\displayWithErrorHandling(), Twig_Template\getParent(), Twig_Template\loadTemplate(), and Twig_Parser\parse().
Twig_Error::setTemplateFile | ( | $name | ) |
Sets the logical name where the error occurred.
string | $name | The name |
Definition at line 124 of file Error.php.
References $name, and updateRepr().
Twig_Error::setTemplateLine | ( | $lineno | ) |
Sets the template line where the error occurred.
int | $lineno | The template line |
Definition at line 179 of file Error.php.
References $lineno, and updateRepr().
Referenced by Twig_Error_Loader\__construct(), Twig_Template\displayBlock(), Twig_Template\displayWithErrorHandling(), Twig_Template\loadTemplate(), and Twig_Parser\parse().
Twig_Error::setTemplateName | ( | $name | ) |
Sets the logical name where the error occurred.
string | $name | The name |
Definition at line 154 of file Error.php.
References $name, and updateRepr().
|
protected |
Definition at line 246 of file Error.php.
References $lineno, $name, $rawMessage, and $sourcePath.
Referenced by __construct(), appendMessage(), guess(), setSourceContext(), setTemplateFile(), setTemplateLine(), and setTemplateName().
|
protected |
Definition at line 38 of file Error.php.
Referenced by Twig_Sandbox_SecurityNotAllowedFilterError\__construct(), Twig_Sandbox_SecurityNotAllowedFunctionError\__construct(), Twig_Sandbox_SecurityNotAllowedTagError\__construct(), Twig_Sandbox_SecurityNotAllowedMethodError\__construct(), Twig_Sandbox_SecurityNotAllowedPropertyError\__construct(), getTemplateFile(), and getTemplateName().
|
protected |
Definition at line 36 of file Error.php.
Referenced by Twig_Sandbox_SecurityNotAllowedFilterError\__construct(), Twig_Sandbox_SecurityNotAllowedTagError\__construct(), Twig_Sandbox_SecurityNotAllowedFunctionError\__construct(), Twig_Sandbox_SecurityNotAllowedPropertyError\__construct(), Twig_Sandbox_SecurityNotAllowedMethodError\__construct(), __construct(), getTemplateLine(), setTemplateLine(), and updateRepr().
|
protected |
Definition at line 40 of file Error.php.
Referenced by __call(), Twig_Sandbox_SecurityNotAllowedFilterError\__construct(), Twig_Sandbox_SecurityNotAllowedTagError\__construct(), Twig_Sandbox_SecurityNotAllowedFunctionError\__construct(), Twig_Sandbox_SecurityNotAllowedPropertyError\__construct(), Twig_Sandbox_SecurityNotAllowedMethodError\__construct(), Twig_Error_Loader\__construct(), and __construct().
|
protected |
Definition at line 39 of file Error.php.
Referenced by appendMessage(), getRawMessage(), and updateRepr().
|
private |
Definition at line 42 of file Error.php.
Referenced by updateRepr().