diff options
| author | Pierre Joye <pajoye@php.net> | 2006-11-03 16:46:19 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2006-11-03 16:46:19 +0000 |
| commit | 8ad0c6d543f5161c5a42536002884a30c153fefd (patch) | |
| tree | 961388a6f097141242ea3c8744a4c1d1c77be72b /ext/zip/tests/utils.inc | |
| parent | c002606a8888a0b85b7095c8809b136a815e0bab (diff) | |
| download | php-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.inc | 16 |
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); + } +} |
