lib/blobfolio/common/file.php
public static function rmdir(string $path) {
		ref\file::path($path, true);
		if (! $path || ! @\is_readable($path) || ! @\is_dir($path)) {
			return false;
		}

		// Scan all files in dir.
		if ($handle = @\opendir($path)) {
			while (false !== ($entry = @\readdir($handle))) {
				// Anything but a dot === not empty.
				if (('.' === $entry) || ('..' === $entry)) {
					continue;
				}

				$file = "{$path}{$entry}";

				// Delete files.
				if (@\is_file($file)) {
					@\unlink($file);
				}
				// Recursively delete directories.
				else {
					static::rmdir($file);
				}
			}
			\closedir($handle);
		}

		if (static::empty_dir($path)) {
			@\rmdir($path);
		}

		return ! @\file_exists($path);
	}
public static function rmdir(string $path) {
		ref\file::path($path, true);
		if (! $path || ! @\is_readable($path) || ! @\is_dir($path)) {
			return false;
		}

		// Scan all files in dir.
		if ($handle = @\opendir($path)) {
			while (false !== ($entry = @\readdir($handle))) {
				// Anything but a dot === not empty.
				if (('.' === $entry) || ('..' === $entry)) {
					continue;
				}

				$file = "{$path}{$entry}";

				// Delete files.
				if (@\is_file($file)) {
					@\unlink($file);
				}
				// Recursively delete directories.
				else {
					static::rmdir($file);
				}
			}
			\closedir($handle);
		}

		if (static::empty_dir($path)) {
			@\rmdir($path);
		}

		return ! @\file_exists($path);
	}
public static function rmdir ( string $ path ) { ref \ file :: path ( $ path , true ) ; if ( ! $ path || ! @ \ is_readable ( $ path ) || ! @ \ is_dir ( $ path ) ) { return false ; } // Scan all files in dir. if ( $ handle = @ \ opendir ( $ path ) ) { while ( false !== ( $ entry = @ \ readdir ( $ handle ) ) ) { // Anything but a dot === not empty. if ( ( '.' === $ entry ) || ( '..' === $ entry ) ) { continue ; } $ file = "{$path}{$entry}" ; // Delete files. if ( @ \ is_file ( $ file ) ) { @ \ unlink ( $ file ) ; } // Recursively delete directories. else { static :: rmdir ( $ file ) ; } } \ closedir ( $ handle ) ; } if ( static :: empty_dir ( $ path ) ) { @ \ rmdir ( $ path ) ; } return ! @ \ file_exists ( $ path ) ; }
Recursively Remove A Directory

@param string $path Path.
@return bool True/false.
Recursively Remove A Directory