(string $dir)
| 79 | } |
| 80 | |
| 81 | function 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 |
no outgoing calls
no test coverage detected