diff --git a/README b/README index beb9c0a4..a8a732ee 100644 --- a/README +++ b/README @@ -5,7 +5,103 @@ Author: Uwe Tews AN INTRODUCTION TO SMARTY 3 BETA -The file structure is similar to Smarty 2: +NOTICE for BETA 8: + +The Smarty 3 API (as of beta 8) has been refactored to a syntax geared +for consistency and modularity. The Smarty 2 API syntax is still supported, but +will throw a deprecation notice. You can disable the notices, but it is highly +recommended to adjust your syntax to Smarty 3, as the Smarty 2 syntax must run +through an extra rerouting wrapper. + +Basically, all Smarty methods now follow the "fooBarBaz" camel case syntax. Also, +all Smarty properties now have getters and setters. So for example, the property +$smarty->cache_dir can be set with $smarty->setCacheDir('foo/') and can be +retrieved with $smarty->getCacheDir(). + +Some of the Smarty 3 APIs have been revoked such as the "is*" methods that were +just duplicate functions of the now available "get*" methods. + +Here is a rundown of the Smarty 3 API: + +$smarty->fetch($template, $cache_id = null, $compile_id = null, $parent = null) +$smarty->display($template, $cache_id = null, $compile_id = null, $parent = null) +$smarty->isCached($template, $cache_id = null, $compile_id = null) +$smarty->createData($parent = null) +$smarty->createTemplate($template, $cache_id = null, $compile_id = null, $parent = null) +$smarty->enableSecurity() +$smarty->setTemplateDir($template_dir) +$smarty->addTemplateDir($template_dir) +$smarty->enableCaching() +$smarty->templateExists($resource_name) +$smarty->loadPlugin($plugin_name, $check = true) +$smarty->loadFilter($type, $name) +$smarty->setExceptionHandler($handler) +$smarty->addPluginsDir($plugins_dir) +$smarty->getGlobal($varname = null) +$smarty->getRegisteredObject($name) +$smarty->getDebugTemplate() +$smarty->setDebugTemplate($tpl_name) +$smarty->assign($tpl_var, $value = null, $nocache = false, $scope = SMARTY_LOCAL_SCOPE) +$smarty->assignGlobal($varname, $value = null, $nocache = false) +$smarty->assignByRef($tpl_var, &$value, $nocache = false, $scope = SMARTY_LOCAL_SCOPE) +$smarty->append($tpl_var, $value = null, $merge = false, $nocache = false, $scope = SMARTY_LOCAL_SCOPE) +$smarty->appendByRef($tpl_var, &$value, $merge = false) +$smarty->clearAssign($tpl_var) +$smarty->clearAllAssign() +$smarty->configLoad($config_file, $sections = null) +$smarty->getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true) +$smarty->getConfigVariable($variable) +$smarty->getStreamVariable($variable) +$smarty->getConfigVars($varname = null) +$smarty->clearConfig($varname = null) + +// some API calls are moved into their own objects: + +$smarty->cache->loadResource($type = null) +$smarty->cache->clearAll($exp_time = null, $type = null) +$smarty->cache->clear($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) + +$smarty->register->block($block_tag, $block_impl, $cacheable = true, $cache_attr = array()) +$smarty->register->compilerFunction($compiler_tag, $compiler_impl, $cacheable = true) +$smarty->register->templateFunction($function_tag, $function_impl, $cacheable = true, $cache_attr = array()) +$smarty->register->modifier($modifier_name, $modifier_impl) +$smarty->register->templateObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) +$smarty->register->outputFilter($function_name) +$smarty->register->postFilter($function_name) +$smarty->register->preFilter($function_name) +$smarty->register->resource($resource_type, $function_names) +$smarty->register->variableFilter($function_name) +$smarty->register->defaultPluginHandler($function_name) +$smarty->register->defaultTemplateHandler($function_name) + +$smarty->unregister->block($block_tag) +$smarty->unregister->compilerFunction($compiler_tag) +$smarty->unregister->templateFunction($function_tag) +$smarty->unregister->modifier($modifier) +$smarty->unregister->templateObject($object_name) +$smarty->unregister->outputFilter($function_name) +$smarty->unregister->postFilter($function_name) +$smarty->unregister->preFilter($function_name) +$smarty->unregister->resource($resource_type) +$smarty->unregister->variableFilter($function_name) + +$smarty->utility->compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) +$smarty->utility->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) +$smarty->utility->getTemplateVars($varname = null, $_ptr = null, $search_parents = true) +$smarty->utility->testInstall() + +// then all the getters/setters, available for all properties. Here are a few: + +$caching = $smarty->getCaching(); // get $smarty->caching +$smarty->setCaching(true); // set $smarty->caching +$smarty->setDeprecationNotices(false); // set $smarty->deprecation_notices +$smarty->setCacheId($id); // set $smarty->cache_id +$debugging = $smarty->getDebugging(); // get $smarty->debugging + + +FILE STRUCTURE + +The Smarty 3 file structure is similar to Smarty 2: /libs/ Smarty.class.php diff --git a/SMARTY2_BC_NOTES b/SMARTY2_BC_NOTES index 52c10bf6..282c64fa 100644 --- a/SMARTY2_BC_NOTES +++ b/SMARTY2_BC_NOTES @@ -1,76 +1,82 @@ -= Known incompatibilities with Smarty 2 = -== PHP Version == -Smarty 3 is PHP 5 only. It will not work with PHP 4. - -== {php} Tag == -The {php} tag is disabled by default. The use of {php} tags is -deprecated. It can be enabled with $smarty->allow_php_tag=true. - -But if you scatter PHP code which belongs together into several -{php} tags it may not work any longer. - -== Delimiters and whitespace == -Delimiters surrounded by whitespace are no longer treated as Smarty tags. -Therefore, { foo } will not compile as a tag, you must use {foo}. This change -Makes Javascript/CSS easier to work with, eliminating the need for {literal}. -This can be disabled by setting $smarty->auto_literal = false; - -== Unquoted Strings == -Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings -in parameters. Smarty3 is more restrictive. You can still pass strings without quotes -so long as they contain no special characters. (anything outside of A-Za-z0-9_) - -For example filename strings must be quoted - -{include file='path/foo.tpl'} - - -== Extending the Smarty class == -Smarty 3 makes use of the __construct method for initialization. If you are extending -the Smarty class, its constructor is not called implicitly if the your child class defines -its own constructor. In order to run Smarty's constructor, a call to parent::__construct() -within your child constructor is required. - - -class MySmarty extends Smarty { - function __construct() { - parent::__construct(); - - // your initialization code goes here - - } -} - - -== Autoloader == -Smarty 3 does register its own autoloader with spl_autoload_register. If your code has -an existing __autoload function then this function must be explicitly registered on -the __autoload stack. See http://us3.php.net/manual/en/function.spl-autoload-register.php -for further details. - -== Plugin Filenames == -Smarty 3 optionally supports the PHP spl_autoloader. The autoloader requires filenames -to be lower case. Because of this, Smarty plugin file names must also be lowercase. -In Smarty 2, mixed case file names did work. - -== Scope of Special Smarty Variables == -In Smarty 2 the special Smarty variables $smarty.section... and $smarty.foreach... -had global scope. If you had loops with the same name in subtemplates you could accidentally -overwrite values of parent template. - -In Smarty 3 these special Smarty variable have only local scope in the template which -is defining the loop. If you need their value in a subtemplate you have to pass them -as parameter. - -{include file='path/foo.tpl' index=$smarty.section.foo.index} - - -== SMARTY_RESOURCE_CHAR_SET == -Smarty 3 sets the constant SMARTY_RESOURCE_CHAR_SET to utf-8 as default template charset. -This is now used also on modifiers like escape as default charset. If your templates use -other charsets make sure that you define the constant accordingly. Otherwise you may not -get any output. - -== newline at {if} tags == -A \n was added to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source. -If one of the {if} tags is at the line end you will now get a newline in the HTML output. += Known incompatibilities with Smarty 2 = + +== Syntax == + +Smarty 3 API has a new syntax. Much of the Smarty 2 syntax is supported but +deprecated. See the README that comes with Smarty 3 for more information. + +== PHP Version == +Smarty 3 is PHP 5 only. It will not work with PHP 4. + +== {php} Tag == +The {php} tag is disabled by default. The use of {php} tags is +deprecated. It can be enabled with $smarty->allow_php_tag=true. + +But if you scatter PHP code which belongs together into several +{php} tags it may not work any longer. + +== Delimiters and whitespace == +Delimiters surrounded by whitespace are no longer treated as Smarty tags. +Therefore, { foo } will not compile as a tag, you must use {foo}. This change +Makes Javascript/CSS easier to work with, eliminating the need for {literal}. +This can be disabled by setting $smarty->auto_literal = false; + +== Unquoted Strings == +Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings +in parameters. Smarty3 is more restrictive. You can still pass strings without quotes +so long as they contain no special characters. (anything outside of A-Za-z0-9_) + +For example filename strings must be quoted + +{include file='path/foo.tpl'} + + +== Extending the Smarty class == +Smarty 3 makes use of the __construct method for initialization. If you are extending +the Smarty class, its constructor is not called implicitly if the your child class defines +its own constructor. In order to run Smarty's constructor, a call to parent::__construct() +within your child constructor is required. + + +class MySmarty extends Smarty { + function __construct() { + parent::__construct(); + + // your initialization code goes here + + } +} + + +== Autoloader == +Smarty 3 does register its own autoloader with spl_autoload_register. If your code has +an existing __autoload function then this function must be explicitly registered on +the __autoload stack. See http://us3.php.net/manual/en/function.spl-autoload-register.php +for further details. + +== Plugin Filenames == +Smarty 3 optionally supports the PHP spl_autoloader. The autoloader requires filenames +to be lower case. Because of this, Smarty plugin file names must also be lowercase. +In Smarty 2, mixed case file names did work. + +== Scope of Special Smarty Variables == +In Smarty 2 the special Smarty variables $smarty.section... and $smarty.foreach... +had global scope. If you had loops with the same name in subtemplates you could accidentally +overwrite values of parent template. + +In Smarty 3 these special Smarty variable have only local scope in the template which +is defining the loop. If you need their value in a subtemplate you have to pass them +as parameter. + +{include file='path/foo.tpl' index=$smarty.section.foo.index} + + +== SMARTY_RESOURCE_CHAR_SET == +Smarty 3 sets the constant SMARTY_RESOURCE_CHAR_SET to utf-8 as default template charset. +This is now used also on modifiers like escape as default charset. If your templates use +other charsets make sure that you define the constant accordingly. Otherwise you may not +get any output. + +== newline at {if} tags == +A \n was added to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source. +If one of the {if} tags is at the line end you will now get a newline in the HTML output. diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index dc81770e..063d3d19 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -184,6 +184,10 @@ class Smarty extends Smarty_Internal_Data { public $caching_type = 'file'; // internal cache resource types public $cache_resource_types = array('file'); + // internal cache resource objects + public $cache_resource_objects = array(); + // internal config properties + public $properties = array(); // config type public $default_config_type = 'file'; // exception handler: array('ExceptionClass','ExceptionMethod'); @@ -216,6 +220,8 @@ class Smarty extends Smarty_Internal_Data { public $_dir_perms = 0771; // smarty object reference public $smarty = null; + // generate deprecated function call notices? + public $deprecation_notices = true; /** * Class constructor, initializes basic smarty properties @@ -268,7 +274,7 @@ class Smarty extends Smarty_Internal_Data { } } if (isset($_SERVER['SCRIPT_NAME'])) { - $this->assign_global('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']); + $this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']); } } @@ -342,13 +348,13 @@ class Smarty extends Smarty_Internal_Data { * @param mixed $compile_id compile id to be used with this template * @return boolean cache status */ - public function is_cached($template, $cache_id = null, $compile_id = null) { + public function isCached($template, $cache_id = null, $compile_id = null) { if (!($template instanceof $this->template_class)) { $template = $this->createTemplate ($template, $cache_id, $compile_id, $this); } // return cache status of template return $template->isCached(); - } + } /** * creates a data object @@ -431,6 +437,7 @@ class Smarty extends Smarty_Internal_Data { $this->template_dir = (array)$template_dir; return; } + /** * Adds template directory(s) to existing ones * @@ -441,40 +448,29 @@ class Smarty extends Smarty_Internal_Data { $this->template_dir = array_unique($this->template_dir); return; } - /** - * Set compile directory - * - * @param string $compile_dir folder of compiled template sources - */ - public function setCompileDir($compile_dir) { - $this->compile_dir = $compile_dir; - return; - } - /** - * Set cache directory - * - * @param string $cache_dir folder of cache files - */ - public function setCacheDir($cache_dir) { - $this->cache_dir = $cache_dir; - return; - } + /** * Enable Caching */ public function enableCaching() { $this->caching = SMARTY_CACHING_LIFETIME_CURRENT; return; - } + } + /** - * Set caching life time + * Check if a template resource exists * - * @param integer $lifetime lifetime of cached file in seconds + * @param string $resource_name template name + * @return boolean status */ - public function setCacheLifetime($lifetime) { - $this->cache_lifetime = $lifetime; - return; - } + function templateExists($resource_name) + { + // create template object + $tpl = new $this->template_class($resource_name, $this); + // check if it does exists + return $tpl->isExisting(); + } + /** * Takes unknown classes and loads plugin files for them * class name format: Smarty_PluginType_PluginName @@ -523,6 +519,29 @@ class Smarty extends Smarty_Internal_Data { return false; } + /** + * load a filter of specified type and name + * + * @param string $type filter type + * @param string $name filter name + * @return bool + */ + function loadFilter($type, $name) + { + $_plugin = "smarty_{$type}filter_{$name}"; + $_filter_name = $_plugin; + if ($this->loadPlugin($_plugin)) { + if (class_exists($_plugin, false)) { + $_plugin = array($_plugin, 'execute'); + } + if (is_callable($_plugin)) { + return $this->registered_filters[$type][$_filter_name] = $_plugin; + } + } + throw new Exception("{$type}filter \"{$name}\" not callable"); + return false; + } + /** * Sets the exception handler for Smarty. * @@ -534,35 +553,6 @@ class Smarty extends Smarty_Internal_Data { return set_exception_handler($handler); } - /** - * Loads cache resource. - * - * @return object of cache resource - */ - public function loadCacheResource($type = null) { - if (!isset($type)) { - $type = $this->caching_type; - } - // already loaded? - if (isset($this->cache_resource_objects[$type])) { - return $this->cache_resource_objects[$type]; - } - if (in_array($type, $this->cache_resource_types)) { - $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type); - return $this->cache_resource_objects[$type] = new $cache_resource_class($this); - } - else { - // try plugins dir - $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type); - if ($this->loadPlugin($cache_resource_class)) { - return $this->cache_resource_objects[$type] = new $cache_resource_class($this); - } - else { - throw new Exception("Unable to load cache resource '{$type}'"); - } - } - } - /** * trigger Smarty error * @@ -573,6 +563,112 @@ class Smarty extends Smarty_Internal_Data { throw new Exception("Smarty error: $error_msg"); } + /** + * Return internal filter name + * + * @param callback $function_name + */ + public function _get_filter_name($function_name) + { + if (is_array($function_name)) { + $_class_name = (is_object($function_name[0]) ? + get_class($function_name[0]) : $function_name[0]); + return $_class_name . '_' . $function_name[1]; + } + else { + return $function_name; + } + } + + /** + * Adds directory of plugin files + * + * @param object $smarty + * @param string $ |array $ plugins folder + * @return + */ + function addPluginsDir($plugins_dir) + { + $this->plugins_dir = array_merge((array)$this->plugins_dir, (array)$plugins_dir); + $this->plugins_dir = array_unique($this->plugins_dir); + return; + } + + /** + * Returns a single or all global variables + * + * @param object $smarty + * @param string $varname variable name or null + * @return string variable value or or array of variables + */ + function getGlobal($varname = null) + { + if (isset($varname)) { + if (isset($this->global_tpl_vars[$varname])) { + return $this->global_tpl_vars[$varname]->value; + } else { + return ''; + } + } else { + $_result = array(); + foreach ($this->global_tpl_vars AS $key => $var) { + $_result[$key] = $var->value; + } + return $_result; + } + } + + /** + * return a reference to a registered object + * + * @param string $name object name + * @return object + */ + function getRegisteredObject($name) + { + if (!isset($this->registered_objects[$name])) + throw new Exception("'$name' is not a registered object"); + + if (!is_object($this->registered_objects[$name][0])) + throw new Exception("registered '$name' is not an object"); + + return $this->registered_objects[$name][0]; + } + + /** + * return name of debugging template + * + * @return string + */ + function getDebugTemplate() + { + return $this->debug_tpl; + } + + /** + * set the debug template + * + * @param string $tpl_name + * @return bool + */ + function setDebugTemplate($tpl_name) + { + return $this->debug_tpl = $tpl_name; + } + + /** + * lazy loads (valid) property objects + * + * @param string $name property name + */ + public function __get($name) { + if(in_array($name,array('register','unregister','utility','cache'))) { + $class = "Smarty_Internal_".ucfirst($name); + return new $class($this); + } + return false; + } + /** * Takes unknown class methods and lazy loads sysplugin files for them * class name format: Smarty_Method_MethodName @@ -582,6 +678,40 @@ class Smarty extends Smarty_Internal_Data { * @param array $args aurgument array */ public function __call($name, $args) { + static $camel_func; + if(!isset($camel_func)) + $camel_func = create_function('$c', 'return "_" . strtolower($c[1]);'); + // PHP4 call to constructor? + if (strtolower($name) == 'smarty') { + throw new Exception('Please use parent::__construct() to call parent constuctor'); + return false; + } + + // see if this is a set/get for a property + $first3 = strtolower(substr($name,0,3)); + if(in_array($first3,array('set','get')) && substr($name,3,1) !== '_') { + // try to keep case correct for future PHP 6.0 case-sensitive class methods + // lcfirst() not available < PHP 5.3.0, so improvise + $property_name = strtolower(substr($name,3,1)).substr($name,4); + // convert camel case to underscored name + $property_name = preg_replace_callback('/([A-Z])/', $camel_func, $property_name); + if(!property_exists($this,$property_name)) { + throw new Exception("property '$property_name' does not exist."); + return false; + } + if($first3 == 'get') + return $this->$property_name; + else + return $this->$property_name = $args[0]; + } + + // Smarty Backward Compatible wrapper + if(!isset($this->wrapper)) { + $this->wrapper = new Smarty_Internal_Wrapper($this); + } + return $this->wrapper->convert($name, $args); + + /* $name = strtolower($name); if ($name == 'smarty') { throw new Exception('Please use parent::__construct() to call parent constuctor'); @@ -594,6 +724,7 @@ class Smarty extends Smarty_Internal_Data { require_once(SMARTY_SYSPLUGINS_DIR . $function_name . '.php'); } return call_user_func_array($function_name, array_merge(array($this), $args)); + */ } } diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php index 3727a22f..2a2eff1d 100644 --- a/libs/sysplugins/smarty_internal_data.php +++ b/libs/sysplugins/smarty_internal_data.php @@ -46,7 +46,7 @@ class Smarty_Internal_Data { * @param mixed $value the value to assign * @param boolean $nocache if true any output of this variable will be not cached */ - public function assign_global($varname, $value = null, $nocache = false) + public function assignGlobal($varname, $value = null, $nocache = false) { if ($varname != '') { $this->smarty->global_tpl_vars[$varname] = new Smarty_variable($value, $nocache); @@ -60,7 +60,7 @@ class Smarty_Internal_Data { * @param boolean $nocache if true any output of this variable will be not cached * @param boolean $scope the scope the variable will have (local,parent or root) */ - public function assign_by_ref($tpl_var, &$value, $nocache = false, $scope = SMARTY_LOCAL_SCOPE) + public function assignByRef($tpl_var, &$value, $nocache = false, $scope = SMARTY_LOCAL_SCOPE) { if ($tpl_var != '') { $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache, $scope); @@ -139,7 +139,7 @@ class Smarty_Internal_Data { * @param mixed $ &$value the referenced value to append * @param boolean $merge flag if array elements shall be merged */ - public function append_by_ref($tpl_var, &$value, $merge = false) + public function appendByRef($tpl_var, &$value, $merge = false) { if ($tpl_var != '' && isset($value)) { if (!isset($this->tpl_vars[$tpl_var])) { @@ -163,7 +163,7 @@ class Smarty_Internal_Data { * * @param string $ |array $tpl_var the template variable(s) to clear */ - public function clear_assign($tpl_var) + public function clearAssign($tpl_var) { if (is_array($tpl_var)) { foreach ($tpl_var as $curr_var) { @@ -177,7 +177,7 @@ class Smarty_Internal_Data { /** * clear all the assigned template variables. */ - public function clear_all_assign() + public function clearAllAssign() { $this->tpl_vars = array(); } @@ -188,7 +188,7 @@ class Smarty_Internal_Data { * @param string $config_file filename * @param mixed $sections array of section names, single section or null */ - public function config_load($config_file, $sections = null) + public function configLoad($config_file, $sections = null) { // load Config class $config = new Smarty_Internal_Config($config_file, $this->smarty); @@ -282,7 +282,7 @@ class Smarty_Internal_Data { * @param string $varname variable name or null * @return string variable value or or array of variables */ - function get_config_vars($varname = null) + function getConfigVars($varname = null) { if (isset($varname)) { if (isset($this->config_vars[$varname])) { @@ -300,7 +300,7 @@ class Smarty_Internal_Data { * * @param string $varname variable name or null */ - function clear_config($varname = null) + function clearConfig($varname = null) { if (isset($varname)) { unset($this->config_vars[$varname]); diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 18c0e5f2..a4c3a91b 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -104,7 +104,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { } // load cache resource if (!$this->resource_object->isEvaluated && ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) { - $this->cache_resource_object = $this->smarty->loadCacheResource(); + $this->cache_resource_object = $this->smarty->cache->loadResource(); } } diff --git a/libs/sysplugins/smarty_method__get_filter_name.php b/libs/sysplugins/smarty_method__get_filter_name.php deleted file mode 100644 index 9bc18fbc..00000000 --- a/libs/sysplugins/smarty_method__get_filter_name.php +++ /dev/null @@ -1,31 +0,0 @@ - diff --git a/libs/sysplugins/smarty_method_addpluginsdir.php b/libs/sysplugins/smarty_method_addpluginsdir.php deleted file mode 100644 index 24eb1137..00000000 --- a/libs/sysplugins/smarty_method_addpluginsdir.php +++ /dev/null @@ -1,27 +0,0 @@ -plugins_dir = array_merge((array)$smarty->plugins_dir, (array)$plugins_dir); - $smarty->plugins_dir = array_unique($smarty->plugins_dir); - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_clear_all_assign.php b/libs/sysplugins/smarty_method_clear_all_assign.php deleted file mode 100644 index 9809f03e..00000000 --- a/libs/sysplugins/smarty_method_clear_all_assign.php +++ /dev/null @@ -1,29 +0,0 @@ -tpl_vars = array(); -} - -?> diff --git a/libs/sysplugins/smarty_method_clear_all_cache.php b/libs/sysplugins/smarty_method_clear_all_cache.php deleted file mode 100644 index 2d263156..00000000 --- a/libs/sysplugins/smarty_method_clear_all_cache.php +++ /dev/null @@ -1,29 +0,0 @@ -loadCacheResource($type); - - return $cacheResource->clearAll($exp_time); -} - -?> diff --git a/libs/sysplugins/smarty_method_clear_assign.php b/libs/sysplugins/smarty_method_clear_assign.php deleted file mode 100644 index 1f1fe0bd..00000000 --- a/libs/sysplugins/smarty_method_clear_assign.php +++ /dev/null @@ -1,37 +0,0 @@ -tpl_vars[$variable])) { - unset($ptr->tpl_vars[$variable]); - } - $ptr = $ptr->parent; - } - } - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_clear_cache.php b/libs/sysplugins/smarty_method_clear_cache.php deleted file mode 100644 index 59b79d77..00000000 --- a/libs/sysplugins/smarty_method_clear_cache.php +++ /dev/null @@ -1,32 +0,0 @@ -loadCacheResource($type); - - return $cacheResource->clear($template_name, $cache_id, $compile_id, $exp_time); -} - -?> diff --git a/libs/sysplugins/smarty_method_clear_compiled_tpl.php b/libs/sysplugins/smarty_method_clear_compiled_tpl.php deleted file mode 100644 index f57f985e..00000000 --- a/libs/sysplugins/smarty_method_clear_compiled_tpl.php +++ /dev/null @@ -1,65 +0,0 @@ -use_sub_dirs ? DS : '^'; - if (isset($resource_name)) { - $_resource_part_1 = $resource_name . '.php'; - $_resource_part_2 = $resource_name . '.cache' . '.php'; - } else { - $_resource_part = ''; - } - $_dir = $smarty->compile_dir; - if ($smarty->use_sub_dirs && isset($_compile_id)) { - $_dir .= $_compile_id . $_dir_sep; - } - if (isset($_compile_id)) { - $_compile_id_part = $smarty->compile_dir . $_compile_id . $_dir_sep; - } - $_count = 0; - $_compileDirs = new RecursiveDirectoryIterator($_dir); - $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); - foreach ($_compile as $_file) { - if (strpos($_file, '.svn') !== false) continue; - if ($_file->isDir()) { - if (!$_compile->isDot()) { - // delete folder if empty - @rmdir($_file->getPathname()); - } - } else { - if ((!isset($_compile_id) || (strlen((string)$_file) > strlen($_compile_id_part) && substr_compare((string)$_file, $_compile_id_part, 0, strlen($_compile_id_part)) == 0)) && - (!isset($resource_name) || (strlen((string)$_file) > strlen($_resource_part_1) && substr_compare((string)$_file, $_resource_part_1, - strlen($_resource_part_1), strlen($_resource_part_1)) == 0) || - (strlen((string)$_file) > strlen($_resource_part_2) && substr_compare((string)$_file, $_resource_part_2, - strlen($_resource_part_2), strlen($_resource_part_2)) == 0))) { - if (isset($exp_time)) { - if (time() - @filemtime($_file) >= $exp_time) { - $_count += @unlink((string) $_file) ? 1 : 0; - } - } else { - $_count += @unlink((string) $_file) ? 1 : 0; - } - } - } - } - return $_count; -} - -?> diff --git a/libs/sysplugins/smarty_method_compile_directory.php b/libs/sysplugins/smarty_method_compile_directory.php deleted file mode 100644 index 48ffff75..00000000 --- a/libs/sysplugins/smarty_method_compile_directory.php +++ /dev/null @@ -1,72 +0,0 @@ -template_dir; - } - // switch off time limit - if (function_exists('set_time_limit')) { - @set_time_limit($time_limit); - } - $smarty->force_compile = $force_compile; - $_count = 0; - $_error_count = 0; - // loop over array of template directories - foreach((array)$smarty->template_dir as $_dir) { - $_compileDirs = new RecursiveDirectoryIterator($_dir); - $_compile = new RecursiveIteratorIterator($_compileDirs); - foreach ($_compile as $_fileinfo) { - if (strpos($_fileinfo, '.svn') !== false) continue; - $_file = $_fileinfo->getFilename(); - if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue; - if ($_fileinfo->getPath() == substr($_dir, 0, -1)) { - $_template_file = $_file; - } else { - $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . '\\' . $_file; - } - echo '
', $_dir, '---', $_template_file; - flush(); - $_start_time = _get_time(); - try { - $_tpl = $smarty->createTemplate($_template_file); - $_tpl->getCompiledTemplate(); - } - catch (Exception $e) { - echo 'Error: ', $e->getMessage(), "

"; - $_error_count++; - } - echo ' done in ', _get_time() - $_start_time, ' seconds'; - if ($max_errors !== null && $_error_count == $max_errors) { - echo '

too many errors'; - exit(); - } - } - } - return $_count; -} - -?> diff --git a/libs/sysplugins/smarty_method_disablecachemodifycheck.php b/libs/sysplugins/smarty_method_disablecachemodifycheck.php deleted file mode 100644 index aac8fabb..00000000 --- a/libs/sysplugins/smarty_method_disablecachemodifycheck.php +++ /dev/null @@ -1,23 +0,0 @@ -cache_modified_check = false; - return ; - } - -?> diff --git a/libs/sysplugins/smarty_method_disablecaching.php b/libs/sysplugins/smarty_method_disablecaching.php deleted file mode 100644 index ba5097af..00000000 --- a/libs/sysplugins/smarty_method_disablecaching.php +++ /dev/null @@ -1,22 +0,0 @@ -smarty->caching = false; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_disablecompilecheck.php b/libs/sysplugins/smarty_method_disablecompilecheck.php deleted file mode 100644 index f18514ff..00000000 --- a/libs/sysplugins/smarty_method_disablecompilecheck.php +++ /dev/null @@ -1,24 +0,0 @@ -compile_check = false; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_disableconfigbooleanize.php b/libs/sysplugins/smarty_method_disableconfigbooleanize.php deleted file mode 100644 index fa7a434b..00000000 --- a/libs/sysplugins/smarty_method_disableconfigbooleanize.php +++ /dev/null @@ -1,22 +0,0 @@ -smarty->config_booleanize = false; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_disableconfigoverwrite.php b/libs/sysplugins/smarty_method_disableconfigoverwrite.php deleted file mode 100644 index d37cea4c..00000000 --- a/libs/sysplugins/smarty_method_disableconfigoverwrite.php +++ /dev/null @@ -1,21 +0,0 @@ -config_overwrite = false; - return ; -} -?> diff --git a/libs/sysplugins/smarty_method_disableconfigreadhidden.php b/libs/sysplugins/smarty_method_disableconfigreadhidden.php deleted file mode 100644 index e5001d60..00000000 --- a/libs/sysplugins/smarty_method_disableconfigreadhidden.php +++ /dev/null @@ -1,21 +0,0 @@ -smarty->config_read_hidden = false; - return; -} -?> diff --git a/libs/sysplugins/smarty_method_disabledebugging.php b/libs/sysplugins/smarty_method_disabledebugging.php deleted file mode 100644 index 3cfccd78..00000000 --- a/libs/sysplugins/smarty_method_disabledebugging.php +++ /dev/null @@ -1,21 +0,0 @@ -debugging = false; - return; -} -?> diff --git a/libs/sysplugins/smarty_method_disabledebuggingurlctrl.php b/libs/sysplugins/smarty_method_disabledebuggingurlctrl.php deleted file mode 100644 index fa149dbd..00000000 --- a/libs/sysplugins/smarty_method_disabledebuggingurlctrl.php +++ /dev/null @@ -1,22 +0,0 @@ -debugging_ctrl = 'none'; - return; - } - -?> diff --git a/libs/sysplugins/smarty_method_disabledefaulttimezone.php b/libs/sysplugins/smarty_method_disabledefaulttimezone.php deleted file mode 100644 index 3aef9cb5..00000000 --- a/libs/sysplugins/smarty_method_disabledefaulttimezone.php +++ /dev/null @@ -1,22 +0,0 @@ -set_timezone = false; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_disableforcecompile.php b/libs/sysplugins/smarty_method_disableforcecompile.php deleted file mode 100644 index 7dab1679..00000000 --- a/libs/sysplugins/smarty_method_disableforcecompile.php +++ /dev/null @@ -1,22 +0,0 @@ -force_compile = false; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_disablevariablefilter.php b/libs/sysplugins/smarty_method_disablevariablefilter.php deleted file mode 100644 index 173bdfe8..00000000 --- a/libs/sysplugins/smarty_method_disablevariablefilter.php +++ /dev/null @@ -1,22 +0,0 @@ -variable_filter = false; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enablecachemodifycheck.php b/libs/sysplugins/smarty_method_enablecachemodifycheck.php deleted file mode 100644 index 31dbbeb4..00000000 --- a/libs/sysplugins/smarty_method_enablecachemodifycheck.php +++ /dev/null @@ -1,22 +0,0 @@ -cache_modified_check = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enablecompilecheck.php b/libs/sysplugins/smarty_method_enablecompilecheck.php deleted file mode 100644 index 23cd2837..00000000 --- a/libs/sysplugins/smarty_method_enablecompilecheck.php +++ /dev/null @@ -1,22 +0,0 @@ -compile_check = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enableconfigbooleanize.php b/libs/sysplugins/smarty_method_enableconfigbooleanize.php deleted file mode 100644 index ab7bd146..00000000 --- a/libs/sysplugins/smarty_method_enableconfigbooleanize.php +++ /dev/null @@ -1,22 +0,0 @@ -config_booleanize = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enableconfigoverwrite.php b/libs/sysplugins/smarty_method_enableconfigoverwrite.php deleted file mode 100644 index 7f0cc716..00000000 --- a/libs/sysplugins/smarty_method_enableconfigoverwrite.php +++ /dev/null @@ -1,22 +0,0 @@ -config_overwrite = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enableconfigreadhidden.php b/libs/sysplugins/smarty_method_enableconfigreadhidden.php deleted file mode 100644 index 982d0fd6..00000000 --- a/libs/sysplugins/smarty_method_enableconfigreadhidden.php +++ /dev/null @@ -1,22 +0,0 @@ -smarty->config_read_hidden = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enabledebugging.php b/libs/sysplugins/smarty_method_enabledebugging.php deleted file mode 100644 index 3f3cc90c..00000000 --- a/libs/sysplugins/smarty_method_enabledebugging.php +++ /dev/null @@ -1,22 +0,0 @@ -smarty->debugging = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enabledebuggingurlctrl.php b/libs/sysplugins/smarty_method_enabledebuggingurlctrl.php deleted file mode 100644 index 07432701..00000000 --- a/libs/sysplugins/smarty_method_enabledebuggingurlctrl.php +++ /dev/null @@ -1,22 +0,0 @@ -debugging_ctrl = 'URL'; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enabledefaulttimezone.php b/libs/sysplugins/smarty_method_enabledefaulttimezone.php deleted file mode 100644 index e5a7f273..00000000 --- a/libs/sysplugins/smarty_method_enabledefaulttimezone.php +++ /dev/null @@ -1,22 +0,0 @@ -smarty->set_timezone = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enableforcecompile.php b/libs/sysplugins/smarty_method_enableforcecompile.php deleted file mode 100644 index f78fc917..00000000 --- a/libs/sysplugins/smarty_method_enableforcecompile.php +++ /dev/null @@ -1,22 +0,0 @@ -force_compile = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_enablevariablefilter.php b/libs/sysplugins/smarty_method_enablevariablefilter.php deleted file mode 100644 index 6abe9231..00000000 --- a/libs/sysplugins/smarty_method_enablevariablefilter.php +++ /dev/null @@ -1,22 +0,0 @@ -variable_filter = true; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_get_global.php b/libs/sysplugins/smarty_method_get_global.php deleted file mode 100644 index 539e0822..00000000 --- a/libs/sysplugins/smarty_method_get_global.php +++ /dev/null @@ -1,37 +0,0 @@ -global_tpl_vars[$varname])) { - return $smarty->global_tpl_vars[$varname]->value; - } else { - return ''; - } - } else { - $_result = array(); - foreach ($smarty->global_tpl_vars AS $key => $var) { - $_result[$key] = $var->value; - } - return $_result; - } -} - -?> diff --git a/libs/sysplugins/smarty_method_get_registered_object.php b/libs/sysplugins/smarty_method_get_registered_object.php deleted file mode 100644 index 147a1f35..00000000 --- a/libs/sysplugins/smarty_method_get_registered_object.php +++ /dev/null @@ -1,34 +0,0 @@ -registered_objects[$name])) - throw new Exception("'$name' is not a registered object"); - - if (!is_object($smarty->registered_objects[$name][0])) - throw new Exception("registered '$name' is not an object"); - - return $smarty->registered_objects[$name][0]; -} - -?> diff --git a/libs/sysplugins/smarty_method_get_template_vars.php b/libs/sysplugins/smarty_method_get_template_vars.php deleted file mode 100644 index 9bfdbd86..00000000 --- a/libs/sysplugins/smarty_method_get_template_vars.php +++ /dev/null @@ -1,56 +0,0 @@ -getVariable($varname, $_ptr, $search_parents); - if (is_object($_var)) { - return $_var->value; - } else { - return null; - } - } else { - $_result = array(); - if ($_ptr === null) { - $_ptr = $smarty; - } while ($_ptr !== null) { - foreach ($_ptr->tpl_vars AS $key => $var) { - $_result[$key] = $var->value; - } - // not found, try at parent - if ($search_parents) { - $_ptr = $_ptr->parent; - } else { - $_ptr = null; - } - } - if ($search_parents) { - foreach ($smarty->global_tpl_vars AS $key => $var) { - $_result[$key] = $var->value; - } - } - return $_result; - } -} - -?> diff --git a/libs/sysplugins/smarty_method_getcachedir.php b/libs/sysplugins/smarty_method_getcachedir.php deleted file mode 100644 index 47ed8776..00000000 --- a/libs/sysplugins/smarty_method_getcachedir.php +++ /dev/null @@ -1,27 +0,0 @@ -smarty->cache_dir; -} - -?> diff --git a/libs/sysplugins/smarty_method_getcachelifetime.php b/libs/sysplugins/smarty_method_getcachelifetime.php deleted file mode 100644 index 0db4fc76..00000000 --- a/libs/sysplugins/smarty_method_getcachelifetime.php +++ /dev/null @@ -1,28 +0,0 @@ -cache_lifetime; -} - -?> diff --git a/libs/sysplugins/smarty_method_getcompiledir.php b/libs/sysplugins/smarty_method_getcompiledir.php deleted file mode 100644 index 929da274..00000000 --- a/libs/sysplugins/smarty_method_getcompiledir.php +++ /dev/null @@ -1,27 +0,0 @@ -smarty->compile_dir; -} - -?> diff --git a/libs/sysplugins/smarty_method_getconfigdir.php b/libs/sysplugins/smarty_method_getconfigdir.php deleted file mode 100644 index 79e55b6e..00000000 --- a/libs/sysplugins/smarty_method_getconfigdir.php +++ /dev/null @@ -1,27 +0,0 @@ -config_dir; -} - -?> diff --git a/libs/sysplugins/smarty_method_getdebugtemplate.php b/libs/sysplugins/smarty_method_getdebugtemplate.php deleted file mode 100644 index 81091695..00000000 --- a/libs/sysplugins/smarty_method_getdebugtemplate.php +++ /dev/null @@ -1,27 +0,0 @@ -debug_tpl; -} - -?> diff --git a/libs/sysplugins/smarty_method_getpluginsdir.php b/libs/sysplugins/smarty_method_getpluginsdir.php deleted file mode 100644 index 6fa98a3f..00000000 --- a/libs/sysplugins/smarty_method_getpluginsdir.php +++ /dev/null @@ -1,27 +0,0 @@ -plugins_dir; -} - -?> diff --git a/libs/sysplugins/smarty_method_gettemplatedir.php b/libs/sysplugins/smarty_method_gettemplatedir.php deleted file mode 100644 index 2fa1df88..00000000 --- a/libs/sysplugins/smarty_method_gettemplatedir.php +++ /dev/null @@ -1,27 +0,0 @@ -template_dir; -} - -?> diff --git a/libs/sysplugins/smarty_method_getvariablefilter.php b/libs/sysplugins/smarty_method_getvariablefilter.php deleted file mode 100644 index 9d7d0c4e..00000000 --- a/libs/sysplugins/smarty_method_getvariablefilter.php +++ /dev/null @@ -1,23 +0,0 @@ -variable_filter; -} - -?> diff --git a/libs/sysplugins/smarty_method_iscachemodifycheck.php b/libs/sysplugins/smarty_method_iscachemodifycheck.php deleted file mode 100644 index 4e93b17a..00000000 --- a/libs/sysplugins/smarty_method_iscachemodifycheck.php +++ /dev/null @@ -1,21 +0,0 @@ -cache_modified_check; -} - -?> diff --git a/libs/sysplugins/smarty_method_iscaching.php b/libs/sysplugins/smarty_method_iscaching.php deleted file mode 100644 index e27bd0ac..00000000 --- a/libs/sysplugins/smarty_method_iscaching.php +++ /dev/null @@ -1,21 +0,0 @@ -caching; -} - -?> diff --git a/libs/sysplugins/smarty_method_iscompilecheck.php b/libs/sysplugins/smarty_method_iscompilecheck.php deleted file mode 100644 index 904ad4ca..00000000 --- a/libs/sysplugins/smarty_method_iscompilecheck.php +++ /dev/null @@ -1,21 +0,0 @@ -compile_check; -} - -?> diff --git a/libs/sysplugins/smarty_method_isconfigbooleanize.php b/libs/sysplugins/smarty_method_isconfigbooleanize.php deleted file mode 100644 index 605474ba..00000000 --- a/libs/sysplugins/smarty_method_isconfigbooleanize.php +++ /dev/null @@ -1,21 +0,0 @@ -config_booleanize; -} - -?> diff --git a/libs/sysplugins/smarty_method_isconfigoverwrite.php b/libs/sysplugins/smarty_method_isconfigoverwrite.php deleted file mode 100644 index fb10f0ea..00000000 --- a/libs/sysplugins/smarty_method_isconfigoverwrite.php +++ /dev/null @@ -1,21 +0,0 @@ -config_overwrite; -} - -?> diff --git a/libs/sysplugins/smarty_method_isconfigreadhidden.php b/libs/sysplugins/smarty_method_isconfigreadhidden.php deleted file mode 100644 index e13c84d0..00000000 --- a/libs/sysplugins/smarty_method_isconfigreadhidden.php +++ /dev/null @@ -1,21 +0,0 @@ -config_read_hidden; - } -?> diff --git a/libs/sysplugins/smarty_method_isdebugging.php b/libs/sysplugins/smarty_method_isdebugging.php deleted file mode 100644 index 9d36eb41..00000000 --- a/libs/sysplugins/smarty_method_isdebugging.php +++ /dev/null @@ -1,21 +0,0 @@ -debugging; -} - -?> diff --git a/libs/sysplugins/smarty_method_isdebuggingurlctrl.php b/libs/sysplugins/smarty_method_isdebuggingurlctrl.php deleted file mode 100644 index 5487cd19..00000000 --- a/libs/sysplugins/smarty_method_isdebuggingurlctrl.php +++ /dev/null @@ -1,21 +0,0 @@ -debugging_ctrl != 'none'; -} - -?> diff --git a/libs/sysplugins/smarty_method_isdefaulttimezone.php b/libs/sysplugins/smarty_method_isdefaulttimezone.php deleted file mode 100644 index dd221177..00000000 --- a/libs/sysplugins/smarty_method_isdefaulttimezone.php +++ /dev/null @@ -1,21 +0,0 @@ -set_timezone = false; -} - -?> diff --git a/libs/sysplugins/smarty_method_isforcecompile.php b/libs/sysplugins/smarty_method_isforcecompile.php deleted file mode 100644 index 94c62a01..00000000 --- a/libs/sysplugins/smarty_method_isforcecompile.php +++ /dev/null @@ -1,23 +0,0 @@ -force_compile; - } - - -?> diff --git a/libs/sysplugins/smarty_method_load_filter.php b/libs/sysplugins/smarty_method_load_filter.php deleted file mode 100644 index cb82ea1d..00000000 --- a/libs/sysplugins/smarty_method_load_filter.php +++ /dev/null @@ -1,35 +0,0 @@ -loadPlugin($_plugin)) { - if (class_exists($_plugin, false)) { - $_plugin = array($_plugin, 'execute'); - } - if (is_callable($_plugin)) { - $smarty->registered_filters[$type][$_filter_name] = $_plugin; - return; - } - } - throw new Exception("{$type}filter \"{$name}\" not callable"); -} - -?> diff --git a/libs/sysplugins/smarty_method_register_block.php b/libs/sysplugins/smarty_method_register_block.php deleted file mode 100644 index 466f8c39..00000000 --- a/libs/sysplugins/smarty_method_register_block.php +++ /dev/null @@ -1,36 +0,0 @@ -registered_plugins['block'][$block_tag])) { - throw new Exception("Plugin tag \"{$block_tag}\" already registered"); - } elseif (!is_callable($block_impl)) { - throw new Exception("Plugin \"{$block_tag}\" not callable"); - } else { - $smarty->registered_plugins['block'][$block_tag] = - array($block_impl, $cacheable, $cache_attr); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_register_compiler_function.php b/libs/sysplugins/smarty_method_register_compiler_function.php deleted file mode 100644 index b338504c..00000000 --- a/libs/sysplugins/smarty_method_register_compiler_function.php +++ /dev/null @@ -1,35 +0,0 @@ -registered_plugins['compiler'][$compiler_tag])) { - throw new Exception("Plugin tag \"{$compiler_tag}\" already registered"); - } elseif (!is_callable($compiler_impl)) { - throw new Exception("Plugin \"{$compiler_tag}\" not callable"); - } else { - $smarty->registered_plugins['compiler'][$compiler_tag] = - array($compiler_impl, $cacheable); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_register_function.php b/libs/sysplugins/smarty_method_register_function.php deleted file mode 100644 index fbdb7815..00000000 --- a/libs/sysplugins/smarty_method_register_function.php +++ /dev/null @@ -1,33 +0,0 @@ -registered_plugins['function'][$function_tag])) { - throw new Exception("Plugin tag \"{$function_tag}\" already registered"); - } elseif (!is_callable($function_impl)) { - throw new Exception("Plugin \"{$function_tag}\" not callable"); - } else { - $smarty->registered_plugins['function'][$function_tag] = - array($function_impl, $cacheable, $cache_attr); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_register_modifier.php b/libs/sysplugins/smarty_method_register_modifier.php deleted file mode 100644 index 022f4f30..00000000 --- a/libs/sysplugins/smarty_method_register_modifier.php +++ /dev/null @@ -1,31 +0,0 @@ -registered_plugins['modifier'][$modifier])) { - throw new Exception("Plugin \"{$modifier}\" already registered"); - } elseif (!is_callable($modifier_impl)) { - throw new Exception("Plugin \"{$modifier}\" not callable"); - } else { - $smarty->registered_plugins['modifier'][$modifier] = - array($modifier_impl); - } -} -?> diff --git a/libs/sysplugins/smarty_method_register_object.php b/libs/sysplugins/smarty_method_register_object.php deleted file mode 100644 index a4d0e607..00000000 --- a/libs/sysplugins/smarty_method_register_object.php +++ /dev/null @@ -1,46 +0,0 @@ -registered_objects[$object] = - array($object_impl, (array)$allowed, (boolean)$smarty_args, (array)$block_methods); -} - -?> diff --git a/libs/sysplugins/smarty_method_register_outputfilter.php b/libs/sysplugins/smarty_method_register_outputfilter.php deleted file mode 100644 index 46012640..00000000 --- a/libs/sysplugins/smarty_method_register_outputfilter.php +++ /dev/null @@ -1,25 +0,0 @@ -registered_filters['output'][$smarty->_get_filter_name($function)] = $function; -} - -?> diff --git a/libs/sysplugins/smarty_method_register_postfilter.php b/libs/sysplugins/smarty_method_register_postfilter.php deleted file mode 100644 index 1d8c2e77..00000000 --- a/libs/sysplugins/smarty_method_register_postfilter.php +++ /dev/null @@ -1,25 +0,0 @@ -registered_filters['post'][$smarty->_get_filter_name($function)] = $function; -} - -?> diff --git a/libs/sysplugins/smarty_method_register_prefilter.php b/libs/sysplugins/smarty_method_register_prefilter.php deleted file mode 100644 index 781700d0..00000000 --- a/libs/sysplugins/smarty_method_register_prefilter.php +++ /dev/null @@ -1,25 +0,0 @@ -registered_filters['pre'][$smarty->_get_filter_name($function)] = $function; -} - -?> diff --git a/libs/sysplugins/smarty_method_register_resource.php b/libs/sysplugins/smarty_method_register_resource.php deleted file mode 100644 index 09f5e891..00000000 --- a/libs/sysplugins/smarty_method_register_resource.php +++ /dev/null @@ -1,33 +0,0 @@ -_plugins['resource'][$type] = - array($functions, false); - } elseif (count($functions) == 5) { - $smarty->_plugins['resource'][$type] = - array(array(array(&$functions[0], $functions[1]) , array(&$functions[0], $functions[2]) , array(&$functions[0], $functions[3]) , array(&$functions[0], $functions[4])) , false); - } else { - throw new Exception("malformed function-list for '$type' in register_resource"); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_register_variablefilter.php b/libs/sysplugins/smarty_method_register_variablefilter.php deleted file mode 100644 index 3052d34b..00000000 --- a/libs/sysplugins/smarty_method_register_variablefilter.php +++ /dev/null @@ -1,25 +0,0 @@ -registered_filters['variable'][$smarty->_get_filter_name($function)] = $function; -} - -?> diff --git a/libs/sysplugins/smarty_method_registerdefaultpluginhandler.php b/libs/sysplugins/smarty_method_registerdefaultpluginhandler.php deleted file mode 100644 index fe1e25b5..00000000 --- a/libs/sysplugins/smarty_method_registerdefaultpluginhandler.php +++ /dev/null @@ -1,28 +0,0 @@ -default_plugin_handler_func = $plugin; - } else { - throw new Exception('Default plugin handler "' . $plugin . '" not callable'); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_registerdefaulttemplatehandler.php b/libs/sysplugins/smarty_method_registerdefaulttemplatehandler.php deleted file mode 100644 index 1b716afe..00000000 --- a/libs/sysplugins/smarty_method_registerdefaulttemplatehandler.php +++ /dev/null @@ -1,28 +0,0 @@ -default_template_handler_func = $function; - } else { - throw new Exception('Default template handler "' . $function . '" not callable'); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_setconfigdir.php b/libs/sysplugins/smarty_method_setconfigdir.php deleted file mode 100644 index 6e501f6a..00000000 --- a/libs/sysplugins/smarty_method_setconfigdir.php +++ /dev/null @@ -1,26 +0,0 @@ -smarty->config_dir = $config_dir; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_setdebugtemplate.php b/libs/sysplugins/smarty_method_setdebugtemplate.php deleted file mode 100644 index 4e9cc1fa..00000000 --- a/libs/sysplugins/smarty_method_setdebugtemplate.php +++ /dev/null @@ -1,28 +0,0 @@ -debug_tpl = $debug_tpl; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_setpluginsdir.php b/libs/sysplugins/smarty_method_setpluginsdir.php deleted file mode 100644 index 57ed8f2d..00000000 --- a/libs/sysplugins/smarty_method_setpluginsdir.php +++ /dev/null @@ -1,29 +0,0 @@ -plugins_dir = (array)$plugins_dir; - return; -} - -?> diff --git a/libs/sysplugins/smarty_method_template_exists.php b/libs/sysplugins/smarty_method_template_exists.php deleted file mode 100644 index 8ece1ae1..00000000 --- a/libs/sysplugins/smarty_method_template_exists.php +++ /dev/null @@ -1,31 +0,0 @@ -template_class($resource_name, $smarty); - // check if it does exists - return $tpl->isExisting(); -} - -?> diff --git a/libs/sysplugins/smarty_method_test.php b/libs/sysplugins/smarty_method_test.php deleted file mode 100644 index 53f8594c..00000000 --- a/libs/sysplugins/smarty_method_test.php +++ /dev/null @@ -1,77 +0,0 @@ -\n"; - - echo "Smarty Installation test...\n"; - - echo "Testing template directory...\n"; - - foreach((array)$smarty->template_dir as $template_dir) { - if (!is_dir($template_dir)) - echo "FAILED: $template_dir is not a directory.\n"; - elseif (!is_readable($template_dir)) - echo "FAILED: $template_dir is not readable.\n"; - else - echo "$template_dir is OK.\n"; - } - - echo "Testing compile directory...\n"; - - if (!is_dir($smarty->compile_dir)) - echo "FAILED: $smarty->compile_dir is not a directory.\n"; - elseif (!is_readable($smarty->compile_dir)) - echo "FAILED: $smarty->compile_dir is not readable.\n"; - elseif (!is_writable($smarty->compile_dir)) - echo "FAILED: $smarty->compile_dir is not writable.\n"; - else - echo "{$smarty->compile_dir} is OK.\n"; - - echo "Testing plugins directory...\n"; - - foreach((array)$smarty->plugins_dir as $plugin_dir) { - if (!is_dir($plugin_dir)) - echo "FAILED: $plugin_dir is not a directory.\n"; - elseif (!is_readable($plugin_dir)) - echo "FAILED: $plugin_dir is not readable.\n"; - else - echo "$plugin_dir is OK.\n"; - } - - echo "Testing cache directory...\n"; - - if (!is_dir($smarty->cache_dir)) - echo "FAILED: $smarty->cache_dir is not a directory.\n"; - elseif (!is_readable($smarty->cache_dir)) - echo "FAILED: $smarty->cache_dir is not readable.\n"; - elseif (!is_writable($smarty->cache_dir)) - echo "FAILED: $smarty->cache_dir is not writable.\n"; - else - echo "{$smarty->cache_dir} is OK.\n"; - - echo "Testing configs directory...\n"; - - if (!is_dir($smarty->config_dir)) - echo "FAILED: $smarty->config_dir is not a directory.\n"; - elseif (!is_readable($smarty->config_dir)) - echo "FAILED: $smarty->config_dir is not readable.\n"; - else - echo "{$smarty->config_dir} is OK.\n"; - - echo "Tests complete.\n"; - - echo "\n"; - - return true; -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_block.php b/libs/sysplugins/smarty_method_unregister_block.php deleted file mode 100644 index d1fecb7b..00000000 --- a/libs/sysplugins/smarty_method_unregister_block.php +++ /dev/null @@ -1,29 +0,0 @@ -registered_plugins['block'][$block_tag])) { - unset($smarty->registered_plugins['block'][$block_tag]); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_compiler_function.php b/libs/sysplugins/smarty_method_unregister_compiler_function.php deleted file mode 100644 index 049214b4..00000000 --- a/libs/sysplugins/smarty_method_unregister_compiler_function.php +++ /dev/null @@ -1,29 +0,0 @@ -registered_plugins['compiler'][$compiler_tag])) { - unset($smarty->registered_plugins['compiler'][$compiler_tag]); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_function.php b/libs/sysplugins/smarty_method_unregister_function.php deleted file mode 100644 index f91b9bb9..00000000 --- a/libs/sysplugins/smarty_method_unregister_function.php +++ /dev/null @@ -1,29 +0,0 @@ -registered_plugins['function'][$function_tag])) { - unset($smarty->registered_plugins['function'][$function_tag]); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_modifier.php b/libs/sysplugins/smarty_method_unregister_modifier.php deleted file mode 100644 index 46191c9f..00000000 --- a/libs/sysplugins/smarty_method_unregister_modifier.php +++ /dev/null @@ -1,29 +0,0 @@ -registered_plugins['modifier'][$modifier])) { - unset($smarty->registered_plugins['modifier'][$modifier]); - } -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_object.php b/libs/sysplugins/smarty_method_unregister_object.php deleted file mode 100644 index 0be5c25c..00000000 --- a/libs/sysplugins/smarty_method_unregister_object.php +++ /dev/null @@ -1,28 +0,0 @@ -registered_objects[$object]); - } - -?> diff --git a/libs/sysplugins/smarty_method_unregister_outputfilter.php b/libs/sysplugins/smarty_method_unregister_outputfilter.php deleted file mode 100644 index b71a7792..00000000 --- a/libs/sysplugins/smarty_method_unregister_outputfilter.php +++ /dev/null @@ -1,28 +0,0 @@ -registered_filters['output'][$smarty->_get_filter_name($function)]); -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_postfilter.php b/libs/sysplugins/smarty_method_unregister_postfilter.php deleted file mode 100644 index 17aa49bb..00000000 --- a/libs/sysplugins/smarty_method_unregister_postfilter.php +++ /dev/null @@ -1,27 +0,0 @@ -registered_filters['post'][$smarty->_get_filter_name($function)]); -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_prefilter.php b/libs/sysplugins/smarty_method_unregister_prefilter.php deleted file mode 100644 index b77eaf65..00000000 --- a/libs/sysplugins/smarty_method_unregister_prefilter.php +++ /dev/null @@ -1,27 +0,0 @@ -registered_filters['pre'][$smarty->_get_filter_name($function)]); -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_resource.php b/libs/sysplugins/smarty_method_unregister_resource.php deleted file mode 100644 index b17875ac..00000000 --- a/libs/sysplugins/smarty_method_unregister_resource.php +++ /dev/null @@ -1,27 +0,0 @@ -plugins['resource'][$type]); -} - -?> diff --git a/libs/sysplugins/smarty_method_unregister_variablefilter.php b/libs/sysplugins/smarty_method_unregister_variablefilter.php deleted file mode 100644 index 032943ba..00000000 --- a/libs/sysplugins/smarty_method_unregister_variablefilter.php +++ /dev/null @@ -1,27 +0,0 @@ -registered_filters['variable'][$smarty->_get_filter_name($function)]); -} - -?>