BladeOne.php
2 years ago
CSV.php
9 months ago
Calculations.php
2 years ago
Currency.php
8 months ago
Device.php
1 year ago
Device_Cache.php
2 years ago
Dir.php
5 months ago
Format.php
5 months ago
Link_Validator.php
6 months ago
Number_Formatter.php
5 months ago
Obj.php
6 months ago
Request.php
11 months ago
Salt.php
1 year ago
Security.php
1 year ago
Server.php
2 years ago
Singleton.php
2 years ago
String_Util.php
2 years ago
Timezone.php
5 months ago
URL.php
6 months ago
WP_Async_Request.php
1 year ago
Dir.php
26 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 | return; |
| 12 | } |
| 13 | $objects = \scandir($directory); |
| 14 | foreach ($objects as $object) { |
| 15 | if ($object !== "." && $object !== "..") { |
| 16 | if (\filetype($directory . "/" . $object) === "dir") { |
| 17 | self::delete($directory . "/" . $object); |
| 18 | } else { |
| 19 | \unlink($directory . "/" . $object); |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | \rmdir($directory); |
| 24 | } |
| 25 | } |
| 26 |