summaryrefslogtreecommitdiff
path: root/lib/smarty3/sysplugins/smarty_internal_undefined.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smarty3/sysplugins/smarty_internal_undefined.php')
-rw-r--r--lib/smarty3/sysplugins/smarty_internal_undefined.php40
1 files changed, 29 insertions, 11 deletions
diff --git a/lib/smarty3/sysplugins/smarty_internal_undefined.php b/lib/smarty3/sysplugins/smarty_internal_undefined.php
index 23563e0..7df0acc 100644
--- a/lib/smarty3/sysplugins/smarty_internal_undefined.php
+++ b/lib/smarty3/sysplugins/smarty_internal_undefined.php
@@ -1,9 +1,9 @@
<?php
/**
- * Smarty Method AppendByRef
+ * Smarty Internal Undefined
*
- * Smarty::appendByRef() method
+ * Class to handle undefined method calls or calls to obsolete runtime extensions
*
* @package Smarty
* @subpackage PluginsInternal
@@ -11,17 +11,31 @@
*/
class Smarty_Internal_Undefined
{
+ /**
+ * Name of undefined extension class
+ *
+ * @var string|null
+ */
+ public $class = null;
/**
- * This function is executed automatically when a compiled or cached template file is included
- * - Decode saved properties from compiled template and cache files
- * - Check if compiled or cache file is valid
+ * Smarty_Internal_Undefined constructor.
*
- * @param \Smarty_Internal_Template $tpl
- * @param array $properties special template properties
- * @param bool $cache flag if called from cache file
+ * @param null|string $class name of undefined extension class
+ */
+ public function __construct($class = null)
+ {
+ $this->class = $class;
+ }
+
+ /**
+ * Wrapper for obsolete class Smarty_Internal_Runtime_ValidateCompiled
+ *
+ * @param \Smarty_Internal_Template $tpl
+ * @param array $properties special template properties
+ * @param bool $cache flag if called from cache file
*
- * @return bool flag if compiled or cache file is valid
+ * @return bool false
*/
public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
{
@@ -44,6 +58,10 @@ class Smarty_Internal_Undefined
*/
public function __call($name, $args)
{
- throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method");
+ if (isset($this->class)) {
+ throw new SmartyException("undefined extension class '{$this->class}'");
+ } else {
+ throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method");
+ }
}
-} \ No newline at end of file
+}