From edb98cd0346020e469c3b61756a98d73ce70796e Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 3 Jun 2005 13:09:08 +0000 Subject: [PATCH] clean_smarty_compile_dir works for files. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@592 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/include/functions.inc b/include/functions.inc index 8aaf46b9b..4e8434a82 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1640,35 +1640,22 @@ function clean_smarty_compile_dir($directory) if(!compare_revision($revision_file, $svn_revision)){ // If revision differs, clean compile directory foreach(scandir($directory) as $file) { - if(!is_link($file) && is_writable($file)) { - // delete file - if(!unlink($file)) { - // This should never be reached - } + if( is_file($directory."/".$file) && + is_writable($directory."/".$file)) { + // delete file + if(!unlink($directory."/".$file)) { + // This should never be reached + } } } + } else { + // Revision matches, nothing to do } } + } else { + // Smarty compile dir is not accessible + // (Smarty will warn about this) } - - - /* No, the revision has changed - and possibly the templates/translations. - Drop the contents of $directory now... */ - //if (true){ - - // foreach($files as $file) { - // if(!is_link($file) && is_writable($file)) { - // // Delete File - // if(!unlink($file)){ - // // File could not be deleted - // } - // } - // } - # Recursively delete contents "$config->...['CONFIG']". and create - # new revision file. NO folow symlinks!!! - // ; - //} - } function create_revision($revision_file, $revision) -- 2.30.2