summaryrefslogtreecommitdiffstats
path: root/web/lib/aur.inc
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib/aur.inc')
-rw-r--r--web/lib/aur.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index 686154f..0db5c12 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -467,5 +467,24 @@ function initeger($inival="0", $isbytes=1) {
return intval($inival) * $multiplier;
}
+# recursive delete directory
+#
+function rm_rf($dirname="") {
+ $d = dir($dirname);
+ while ($f = $d->read()) {
+ if ($f != "." && $f != "..") {
+ if (is_dir($dirname.$f)) {
+ rm_rf($dirname.$f."/");
+ }
+ if (is_file($dirname.$f) || is_link($dirname.$f)) {
+ unlink($dirname.$f);
+ }
+ }
+ }
+ $d->close();
+ rmdir($dirname);
+ return;
+}
+
# vim: ts=2 sw=2 noet ft=php
?>