MCPcopy Create free account
hub / github.com/error311/FileRise / rrmdir

Function rrmdir

tests/security/auth_security_regressions.php:81–99  ·  view source on GitHub ↗
(string $dir)

Source from the content-addressed store, hash-verified

79}
80
81function rrmdir(string $dir): void
82{
83 if (!is_dir($dir)) {
84 return;
85 }
86 $items = scandir($dir);
87 foreach ($items as $item) {
88 if ($item === '.' || $item === '..') {
89 continue;
90 }
91 $path = $dir . DIRECTORY_SEPARATOR . $item;
92 if (is_dir($path)) {
93 rrmdir($path);
94 } else {
95 @unlink($path);
96 }
97 }
98 @rmdir($dir);
99}
100
101$token = 'tok_' . bin2hex(random_bytes(12));
102

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected