mirror of
https://github.com/smarty-php/smarty.git
synced 2026-04-29 10:13:25 +02:00
-improvement not to delete files starting with '.' from cache and template_c folders on clearCompiledTemplate() and clearCache()
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user