mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- cleanup convert cache resource file method clear into runtime extension
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
===== 3.1.31-dev ===== (xx.xx.xx)
|
===== 3.1.31-dev ===== (xx.xx.xx)
|
||||||
19.09.2016
|
19.09.2016
|
||||||
- optimization clear compiled and cached folder completely on detected version change
|
- optimization clear compiled and cached folder completely on detected version change
|
||||||
|
- cleanup convert cache resource file method clear into runtime extension
|
||||||
|
|
||||||
15.09.2016
|
15.09.2016
|
||||||
- bugfix assigning a variable in if condition by function like {if $value = array_shift($array)} the function got called twice https://github.com/smarty-php/smarty/issues/291
|
- bugfix assigning a variable in if condition by function like {if $value = array_shift($array)} the function got called twice https://github.com/smarty-php/smarty/issues/291
|
||||||
|
@@ -114,7 +114,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.31-dev/24';
|
const SMARTY_VERSION = '3.1.31-dev/25';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
|
@@ -148,7 +148,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
|
|||||||
*/
|
*/
|
||||||
public function clearAll(Smarty $smarty, $exp_time = null)
|
public function clearAll(Smarty $smarty, $exp_time = null)
|
||||||
{
|
{
|
||||||
return Smarty_Internal_Extension_Clear::clear($smarty, null, null, null, $exp_time);
|
return $smarty->ext->_cacheResourceFile->clear($smarty, null, null, null, $exp_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,7 +164,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
|
|||||||
*/
|
*/
|
||||||
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
||||||
{
|
{
|
||||||
return Smarty_Internal_Extension_Clear::clear($smarty, $resource_name, $cache_id, $compile_id, $exp_time);
|
return $smarty->ext->_cacheResourceFile->clear($smarty, $resource_name, $cache_id, $compile_id, $exp_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
*
|
*
|
||||||
* Runtime extensions
|
* Runtime extensions
|
||||||
* @property Smarty_Internal_Runtime_CacheModify $_cacheModify
|
* @property Smarty_Internal_Runtime_CacheModify $_cacheModify
|
||||||
|
* @property Smarty_Internal_Runtime_CacheResourceFile $_cacheResourceFile
|
||||||
* @property Smarty_Internal_Runtime_Capture $_capture
|
* @property Smarty_Internal_Runtime_Capture $_capture
|
||||||
* @property Smarty_Internal_Runtime_CodeFrame $_codeFrame
|
* @property Smarty_Internal_Runtime_CodeFrame $_codeFrame
|
||||||
* @property Smarty_Internal_Runtime_FilterHandler $_filterHandler
|
* @property Smarty_Internal_Runtime_FilterHandler $_filterHandler
|
||||||
@@ -76,8 +77,8 @@ class Smarty_Internal_Extension_Handler
|
|||||||
preg_split('/([A-Z][^A-Z]*)/', $prop,
|
preg_split('/([A-Z][^A-Z]*)/', $prop,
|
||||||
- 1, PREG_SPLIT_NO_EMPTY |
|
- 1, PREG_SPLIT_NO_EMPTY |
|
||||||
PREG_SPLIT_DELIM_CAPTURE)));
|
PREG_SPLIT_DELIM_CAPTURE)));
|
||||||
$this->_property_info[ $prop ] = property_exists($data, $pn) ? 1 :
|
$this->_property_info[ $prop ] =
|
||||||
($data->_isTplObj() && property_exists($smarty, $pn) ? 2 : 0);
|
property_exists($data, $pn) ? 1 : ($data->_isTplObj() && property_exists($smarty, $pn) ? 2 : 0);
|
||||||
}
|
}
|
||||||
if ($this->_property_info[ $prop ]) {
|
if ($this->_property_info[ $prop ]) {
|
||||||
$pn = $this->resolvedProperties[ $prop ];
|
$pn = $this->resolvedProperties[ $prop ];
|
||||||
@@ -111,7 +112,8 @@ class Smarty_Internal_Extension_Handler
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function upperCase($name) {
|
public function upperCase($name)
|
||||||
|
{
|
||||||
$_name = explode('_', $name);
|
$_name = explode('_', $name);
|
||||||
$_name = array_map('ucfirst', $_name);
|
$_name = array_map('ucfirst', $_name);
|
||||||
return implode('_', $_name);
|
return implode('_', $_name);
|
||||||
|
@@ -1,15 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty Extension Clear
|
* Smarty cache resource file clear method
|
||||||
*
|
|
||||||
* $smarty->clear() method file cache file resource
|
|
||||||
*
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage PluginsInternal
|
* @subpackage PluginsInternal
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*/
|
*/
|
||||||
class Smarty_Internal_Extension_Clear
|
|
||||||
|
/**
|
||||||
|
* Smarty Internal Runtime Cache Resource File Class
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage PluginsInternal
|
||||||
|
*/
|
||||||
|
class Smarty_Internal_Runtime_CacheResourceFile
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Empty cache for a specific template
|
* Empty cache for a specific template
|
||||||
@@ -22,7 +27,7 @@ class Smarty_Internal_Extension_Clear
|
|||||||
*
|
*
|
||||||
* @return integer number of cache files deleted
|
* @return integer number of cache files deleted
|
||||||
*/
|
*/
|
||||||
public static function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
||||||
{
|
{
|
||||||
$_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
|
$_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
|
||||||
$_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null;
|
$_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null;
|
@@ -406,7 +406,6 @@ class Smarty_Internal_TestInstall
|
|||||||
'smarty_internal_configfileparser.php' => true,
|
'smarty_internal_configfileparser.php' => true,
|
||||||
'smarty_internal_config_file_compiler.php' => true,
|
'smarty_internal_config_file_compiler.php' => true,
|
||||||
'smarty_internal_data.php' => true, 'smarty_internal_debug.php' => true,
|
'smarty_internal_data.php' => true, 'smarty_internal_debug.php' => true,
|
||||||
'smarty_internal_extension_clear.php' => true,
|
|
||||||
'smarty_internal_extension_handler.php' => true,
|
'smarty_internal_extension_handler.php' => true,
|
||||||
'smarty_internal_method_addautoloadfilters.php' => true,
|
'smarty_internal_method_addautoloadfilters.php' => true,
|
||||||
'smarty_internal_method_adddefaultmodifiers.php' => true,
|
'smarty_internal_method_adddefaultmodifiers.php' => true,
|
||||||
@@ -471,6 +470,7 @@ class Smarty_Internal_TestInstall
|
|||||||
'smarty_internal_resource_stream.php' => true,
|
'smarty_internal_resource_stream.php' => true,
|
||||||
'smarty_internal_resource_string.php' => true,
|
'smarty_internal_resource_string.php' => true,
|
||||||
'smarty_internal_runtime_cachemodify.php' => true,
|
'smarty_internal_runtime_cachemodify.php' => true,
|
||||||
|
'smarty_internal_runtime_cacheresourcefile.php' => true,
|
||||||
'smarty_internal_runtime_capture.php' => true,
|
'smarty_internal_runtime_capture.php' => true,
|
||||||
'smarty_internal_runtime_codeframe.php' => true,
|
'smarty_internal_runtime_codeframe.php' => true,
|
||||||
'smarty_internal_runtime_filterhandler.php' => true,
|
'smarty_internal_runtime_filterhandler.php' => true,
|
||||||
|
Reference in New Issue
Block a user