Initial commit.

This commit is contained in:
2026-03-10 21:25:26 +08:00
commit 78739bf725
3089 changed files with 472990 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
// File name: rmalldir.inc.php
// Description: PHP subroutine to remove a whole directory
// Date: 2004-03-01
// Author: imacat <imacat@pristine.com.tw>
// Copyright: Copyright (C) 2004-2007 Pristine Communications
// rmalldir: Remove a whole directory
// Input: The directory $dir to be removed. It won't check at all
// Output: none
function rmalldir($dir)
{
// Non-existing
if (!file_exists($dir)) {
return;
}
// Get everything inside
$ents = array();
$dh = opendir($dir);
while (($ent = readdir($dh)) !== false) {
// Not a real entry
if ($ent == "." || $ent == "..") {
continue;
}
$ents[] = "$dir/$ent";
}
closedir($dh);
// Remove them
foreach ($ents as $ent) {
if (is_dir($ent)) {
rmalldir($ent);
} else {
unlink($ent);
}
}
rmdir($dir);
return;
}
?>