public static function recursiveUnlink(string $folder, bool $remove_folder = true): bool {

        try {

            self::emptyFolder($folder);
            if ( $remove_folder && rmdir($folder) === false ) {
                throw new Exception("Error deleting folder: $folder");
            }
            return true;

        } catch (Exception $e) {
            throw $e;
        }

    }