aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php')
-rw-r--r--vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php52
1 files changed, 29 insertions, 23 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php
index bb3e4e138..c1abbb321 100644
--- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php
+++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php
@@ -6,7 +6,6 @@
* @package Smarty
* @subpackage PluginsInternal
* @author Uwe Tews
- *
**/
class Smarty_Internal_Runtime_UpdateCache
{
@@ -15,7 +14,7 @@ class Smarty_Internal_Runtime_UpdateCache
*
* @param \Smarty_Template_Cached $cached
* @param Smarty_Internal_Template $_template
- * @param string $content
+ * @param string $content
*/
public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)
{
@@ -65,35 +64,44 @@ class Smarty_Internal_Runtime_UpdateCache
*
* @throws \SmartyException
*/
- public function removeNoCacheHash(Smarty_Template_Cached $cached,
- Smarty_Internal_Template $_template,
- $no_output_filter)
- {
+ public function removeNoCacheHash(
+ Smarty_Template_Cached $cached,
+ Smarty_Internal_Template $_template,
+ $no_output_filter
+ ) {
$php_pattern = '/(<%|%>|<\?php|<\?|\?>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>)/';
$content = ob_get_clean();
$hash_array = $cached->hashes;
- $hash_array[$_template->compiled->nocache_hash] = true;
+ $hash_array[ $_template->compiled->nocache_hash ] = true;
$hash_array = array_keys($hash_array);
$nocache_hash = '(' . implode('|', $hash_array) . ')';
$_template->cached->has_nocache_code = false;
// get text between non-cached items
$cache_split =
- preg_split("!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s",
- $content);
+ preg_split(
+ "!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s",
+ $content
+ );
// get non-cached items
- preg_match_all("!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s",
- $content,
- $cache_parts);
+ preg_match_all(
+ "!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s",
+ $content,
+ $cache_parts
+ );
$content = '';
// loop over items, stitch back together
foreach ($cache_split as $curr_idx => $curr_split) {
if (preg_match($php_pattern, $curr_split)) {
// escape PHP tags in template content
- $php_split = preg_split($php_pattern,
- $curr_split);
- preg_match_all($php_pattern,
- $curr_split,
- $php_parts);
+ $php_split = preg_split(
+ $php_pattern,
+ $curr_split
+ );
+ preg_match_all(
+ $php_pattern,
+ $curr_split,
+ $php_parts
+ );
foreach ($php_split as $idx_php => $curr_php) {
$content .= $curr_php;
if (isset($php_parts[ 0 ][ $idx_php ])) {
@@ -108,9 +116,9 @@ class Smarty_Internal_Runtime_UpdateCache
$content .= $cache_parts[ 2 ][ $curr_idx ];
}
}
- if (!$no_output_filter && !$_template->cached->has_nocache_code &&
- (isset($_template->smarty->autoload_filters[ 'output' ]) ||
- isset($_template->smarty->registered_filters[ 'output' ]))
+ if (!$no_output_filter && !$_template->cached->has_nocache_code
+ && (isset($_template->smarty->autoload_filters[ 'output' ])
+ || isset($_template->smarty->registered_filters[ 'output' ]))
) {
$content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template);
}
@@ -162,7 +170,6 @@ class Smarty_Internal_Runtime_UpdateCache
if ($_template->smarty->cache_locking) {
$cached->handler->releaseLock($_template->smarty, $cached);
}
-
return true;
}
$cached->content = null;
@@ -171,7 +178,6 @@ class Smarty_Internal_Runtime_UpdateCache
$cached->valid = false;
$cached->processed = false;
}
-
return false;
}
-} \ No newline at end of file
+}