diff options
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php')
-rw-r--r-- | vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php index c019c59db..bf4929807 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php @@ -24,10 +24,10 @@ class Smarty_Internal_Method_ClearCompiledTemplate * @api Smarty::clearCompiledTemplate() * @link http://www.smarty.net/docs/en/api.clear.compiled.template.tpl * - * @param \Smarty $smarty - * @param string $resource_name template name - * @param string $compile_id compile id - * @param integer $exp_time expiration time + * @param \Smarty $smarty + * @param string $resource_name template name + * @param string $compile_id compile id + * @param integer $exp_time expiration time * * @return int number of template files deleted * @throws \SmartyException @@ -69,8 +69,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate try { $_compileDirs = new RecursiveDirectoryIterator($_dir); // NOTE: UnexpectedValueException thrown for PHP >= 5.3 - } - catch (Exception $e) { + } catch (Exception $e) { return 0; } $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); @@ -90,18 +89,22 @@ class Smarty_Internal_Method_ClearCompiledTemplate continue; } $unlink = false; - if ((!isset($_compile_id) || (isset($_filepath[ $_compile_id_part_length ]) && $a = - !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) && - (!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ]) && - substr_compare($_filepath, - $_resource_part_1, - -$_resource_part_1_length, - $_resource_part_1_length) === - 0) || (isset($_filepath[ $_resource_part_2_length ]) && - substr_compare($_filepath, - $_resource_part_2, - -$_resource_part_2_length, - $_resource_part_2_length) === 0)) + if ((!isset($_compile_id) || + (isset($_filepath[ $_compile_id_part_length ]) && + $a = !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) + && (!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ]) + && substr_compare( + $_filepath, + $_resource_part_1, + -$_resource_part_1_length, + $_resource_part_1_length + ) === 0) || (isset($_filepath[ $_resource_part_2_length ]) + && substr_compare( + $_filepath, + $_resource_part_2, + -$_resource_part_2_length, + $_resource_part_2_length + ) === 0)) ) { if (isset($exp_time)) { if (is_file($_filepath) && time() - filemtime($_filepath) >= $exp_time) { @@ -117,7 +120,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1) ) { opcache_invalidate($_filepath, true); - } else if (function_exists('apc_delete_file')) { + } elseif (function_exists('apc_delete_file')) { apc_delete_file($_filepath); } } @@ -125,4 +128,4 @@ class Smarty_Internal_Method_ClearCompiledTemplate } return $_count; } -}
\ No newline at end of file +} |