From 7d6a5eca4e0a38ae615634542859d29ab79c94e8 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sun, 18 Dec 2011 14:25:13 +0100 Subject: Modified db-model for plugins and fixed a bug in the frontend. * The db-model for plugins was updated, so it is compatible with the plugin packages. * Preview of comments now works again. --- ratatoeskr/sys/utils.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ratatoeskr/sys/utils.php') diff --git a/ratatoeskr/sys/utils.php b/ratatoeskr/sys/utils.php index 5d0c3dc..d6093ca 100644 --- a/ratatoeskr/sys/utils.php +++ b/ratatoeskr/sys/utils.php @@ -199,6 +199,28 @@ function htmlesc($text) return htmlentities($text, ENT_QUOTES, "UTF-8"); } +/* + * Function: delete_directory + * Delete a directory and all of its content. + */ +function delete_directory($dir) +{ + $dir_content = scandir($dir); + foreach($dir_content as $f) + { + if(($f == "..") or ($f == ".")) + continue; + + $f = "$dir/$f"; + + if(is_dir($f)) + delete_directory($f); + else + unlink($f); + } + rmdir($dir); +} + /* * Constant: SITE_BASE_PATH * The Base path of this ratatoeskr site. -- cgit v1.2.3-70-g09d2