php-src/ext/zip/tests/utils.inc
Peter Kokot 0eabd5231b Remove unused Git ident attributes from zip extension
$Id attributes were used with SVN. With Git most of the Git ident
attributes in source code files are not used anymore.
2018-07-27 15:49:34 +02:00

24 lines
512 B
PHP

<?php
function dump_entries_name($z) {
for($i=0; $i<$z->numFiles; $i++) {
$sb = $z->statIndex($i);
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);
}
}