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

		// Scan all files in dir.
		if ($handle = @\opendir($path)) {
			while (false !== ($file = @\readdir($handle))) {
				// Anything but a dot === not empty.
				if (('.' !== $file) && ('..' !== $file)) {
					return false;
				}
			}
			\closedir($handle);
			return true;
		}

		return false;
	}
public static function empty_dir(string $path) {
		if (! @\is_readable($path) || ! @\is_dir($path)) {
			return false;
		}

		// Scan all files in dir.
		if ($handle = @\opendir($path)) {
			while (false !== ($file = @\readdir($handle))) {
				// Anything but a dot === not empty.
				if (('.' !== $file) && ('..' !== $file)) {
					return false;
				}
			}
			\closedir($handle);
			return true;
		}

		return false;
	}
public static function empty_dir ( string $ path ) { if ( ! @ \ is_readable ( $ path ) || ! @ \ is_dir ( $ path ) ) { return false ; } // Scan all files in dir. if ( $ handle = @ \ opendir ( $ path ) ) { while ( false !== ( $ file = @ \ readdir ( $ handle ) ) ) { // Anything but a dot === not empty. if ( ( '.' !== $ file ) && ( '..' !== $ file ) ) { return false ; } } \ closedir ( $ handle ) ; return true ; } return false ; }
Is Directory Empty?

@param string $path Path.
@return bool True/false.
Is Directory Empty?