summaryrefslogtreecommitdiff
path: root/ext/zip/tests/utils.inc
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2006-11-03 16:46:19 +0000
committerPierre Joye <pajoye@php.net>2006-11-03 16:46:19 +0000
commit8ad0c6d543f5161c5a42536002884a30c153fefd (patch)
tree961388a6f097141242ea3c8744a4c1d1c77be72b /ext/zip/tests/utils.inc
parentc002606a8888a0b85b7095c8809b136a815e0bab (diff)
downloadphp-git-8ad0c6d543f5161c5a42536002884a30c153fefd.tar.gz
- MFH:
- fix possible leak in statName and statIndex - add addEmptyDir() method - add zip_stat_init,zip_clear_error and zip_file_clear_error - add tests - Fix protos (Hannes) - setComment return value on success (Hannes)
Diffstat (limited to 'ext/zip/tests/utils.inc')
-rw-r--r--ext/zip/tests/utils.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/zip/tests/utils.inc b/ext/zip/tests/utils.inc
index 41a2791266..02e37f6d54 100644
--- a/ext/zip/tests/utils.inc
+++ b/ext/zip/tests/utils.inc
@@ -6,3 +6,19 @@ function dump_entries_name($z) {
echo $i . ' ' . $sb['name'] . "\n";
}
}
+/* recursively remove a directoryy */
+function rmdir_rf($dir) {
+ if ($handle = opendir($dir)) {
+ while (false !== ($item = readdir($handle))) {
+ if ($item != "." && $item != "..") {
+ if (is_dir($dir . '/' . $item)) {
+ rmdir_rf($dir . '/' . $item);
+ } else {
+ unlink($dir . '/' . $item);
+ }
+ }
+ }
+ closedir($handle);
+ rmdir($dir);
+ }
+}