-improvement not to delete files starting with '.' from cache and template_c folders on clearCompiledTemplate() and clearCache()

This commit is contained in:
uwe.tews@googlemail.com
2011-02-17 15:43:37 +00:00
parent 5a6c3e6928
commit 0e863c651d
3 changed files with 7 additions and 4 deletions

View File

@@ -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

View File

@@ -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()) {

View File

@@ -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