BladeOne.php
2 years ago
CSV.php
2 years ago
Currency.php
2 years ago
Device.php
2 years ago
Dir.php
2 years ago
Number_Formatter.php
2 years ago
Request.php
2 years ago
Salt.php
2 years ago
Security.php
2 years ago
Server.php
2 years ago
Singleton.php
2 years ago
String_Util.php
2 years ago
URL.php
2 years ago
WP_Async_Request.php
2 years ago
WordPress_Site_Date_Format_Pattern.php
2 years ago
Dir.php
25 lines
| 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 |