PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.8.3
Independent Analytics – WordPress Analytics Plugin v2.8.3
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / IAWP / Utils / Dir.php
Dir.php
25 lines 629 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IAWP\Utils;
4
5 /** @internal */
6 class Dir
7 {
8 public static function delete($directory)
9 {
10 if (\is_dir($directory)) {
11 $objects = \scandir($directory);
12 foreach ($objects as $object) {
13 if ($object !== "." && $object !== "..") {
14 if (\filetype($directory . "/" . $object) === "dir") {
15 self::delete($directory . "/" . $object);
16 } else {
17 \unlink($directory . "/" . $object);
18 }
19 }
20 }
21 \rmdir($directory);
22 }
23 }
24 }
25