From 230c5787e659580bb80a9e59d1b8630b681afd2f Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Sun, 9 Nov 2014 06:42:20 +0100 Subject: [PATCH] move Smarty exceptions into syslibs folder --- libs/Smarty.class.php | 54 +-------------------- libs/sysplugins/smartycompilerexception.php | 39 +++++++++++++++ libs/sysplugins/smartyexception.php | 15 ++++++ 3 files changed, 56 insertions(+), 52 deletions(-) create mode 100644 libs/sysplugins/smartycompilerexception.php create mode 100644 libs/sysplugins/smartyexception.php diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 6dc549ad..72349ad9 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1594,58 +1594,6 @@ if (Smarty::$_CHARSET !== 'UTF-8') { Smarty::$_UTF8_MODIFIER = ''; } -/** - * Smarty exception class - * - * @package Smarty - */ -class SmartyException extends Exception -{ - public static $escape = false; - - public function __toString() - { - return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; - } -} - -/** - * Smarty compiler exception class - * - * @package Smarty - */ -class SmartyCompilerException extends SmartyException -{ - public function __toString() - { - 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; -} /** * Autoloader @@ -1664,6 +1612,8 @@ function smartyAutoload($class) 'smarty_resource_custom' => true, 'smarty_resource_uncompiled' => true, 'smarty_resource_recompiled' => true, + 'smartyexception' => true, + 'smartycompilerexception' => true, ); if (!strncmp($_class, 'smarty_internal_', 16) || isset($_classes[$_class])) { diff --git a/libs/sysplugins/smartycompilerexception.php b/libs/sysplugins/smartycompilerexception.php new file mode 100644 index 00000000..4d5d7787 --- /dev/null +++ b/libs/sysplugins/smartycompilerexception.php @@ -0,0 +1,39 @@ + 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; +} diff --git a/libs/sysplugins/smartyexception.php b/libs/sysplugins/smartyexception.php new file mode 100644 index 00000000..3da16c27 --- /dev/null +++ b/libs/sysplugins/smartyexception.php @@ -0,0 +1,15 @@ + Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; + } +}