diff --git a/change_log.txt b/change_log.txt index e67d5805..159caf02 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== SVN trunk ===== +17/02/2011 +-improvement not to delete files starting with '.' from cache and template_c folders on clearCompiledTemplate() and clearCache() + 16/02/2011 -fixed typo in exception message of Smarty_Internal_Template -improvement allow leading spaces on } tag closing if auto_literal is enabled diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index c2f9a726..275f8728 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -159,7 +159,7 @@ class Smarty_Internal_CacheResource_File { $_cacheDirs = new RecursiveDirectoryIterator($_dir); $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST); foreach ($_cache as $_file) { - if (strpos($_file, '.svn') !== false) continue; + if (substr($_file->getBasename(),0,1) == '.') continue; // directory ? if ($_file->isDir()) { if (!$_cache->isDot()) { diff --git a/libs/sysplugins/smarty_internal_utility.php b/libs/sysplugins/smarty_internal_utility.php index b532e4a1..7ce33a67 100644 --- a/libs/sysplugins/smarty_internal_utility.php +++ b/libs/sysplugins/smarty_internal_utility.php @@ -66,7 +66,7 @@ class Smarty_Internal_Utility { $_compileDirs = new RecursiveDirectoryIterator($_dir); $_compile = new RecursiveIteratorIterator($_compileDirs); foreach ($_compile as $_fileinfo) { - if (strpos($_fileinfo, '.svn') !== false) continue; + if (substr($_fileinfo->getBasename(),0,1) == '.') continue; $_file = $_fileinfo->getFilename(); if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue; if ($_fileinfo->getPath() == substr($_dir, 0, -1)) { @@ -131,7 +131,7 @@ class Smarty_Internal_Utility { $_compileDirs = new RecursiveDirectoryIterator($_dir); $_compile = new RecursiveIteratorIterator($_compileDirs); foreach ($_compile as $_fileinfo) { - if (strpos($_fileinfo, '.svn') !== false) continue; + if (substr($_fileinfo->getBasename(),0,1) == '.') continue; $_file = $_fileinfo->getFilename(); if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue; if ($_fileinfo->getPath() == substr($_dir, 0, -1)) { @@ -195,7 +195,7 @@ class Smarty_Internal_Utility { $_compileDirs = new RecursiveDirectoryIterator($_dir); $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); foreach ($_compile as $_file) { - if (strpos($_file, '.svn') !== false) continue; + if (substr($_file->getBasename(),0,1) == '.') continue; if ($_file->isDir()) { if (!$_compile->isDot()) { // delete folder if empty