summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: edb98cd)
raw | patch | inline | side by side (parent: edb98cd)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 3 Jun 2005 13:32:52 +0000 (13:32 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 3 Jun 2005 13:32:52 +0000 (13:32 +0000) |
include/functions.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index 4e8434a828ae7bfecef4796a0f214fb92f42d712..53263f3b74d7400a35b3eab3a9d0a390bc721c92 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
{
}
+function rmdirRecursive($path, $followLinks=false) {
+ $dir= opendir($path);
+ while($entry= readdir($dir)) {
+ if(is_file($path."/".$entry) || ((!$followLinks) && is_link($path."/".$entry))) {
+ unlink($path."/".$entry);
+ } elseif (is_dir($path."/".$entry) && $entry!='.' && $entry!='..') {
+ rmdirRecursive($path."/".$entry);
+ }
+ }
+ closedir($dir);
+ return rmdir($path);
+}
function clean_smarty_compile_dir($directory)
{
if(!unlink($directory."/".$file)) {
// This should never be reached
}
+ } elseif(is_dir($directory."/".$file) &&
+ is_writable($directory."/".$file)) {
+ // Just recursively delete it
+ rmdirRecursive($directory."/".$file);
}
}
+ // We should now create a fresh revision file
+ clean_smarty_compile_dir($directory);
} else {
// Revision matches, nothing to do
}