From 0fd4991dd45cdbd19dfb82b43b02d80bfe8d5073 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 17 Jul 2015 17:06:20 -0600 Subject: [PATCH] Fix for issue #225 - zip skipping required empty folders --- system/src/Grav/Common/Backup/ZipBackup.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Common/Backup/ZipBackup.php b/system/src/Grav/Common/Backup/ZipBackup.php index d275d21eb..1322c024d 100644 --- a/system/src/Grav/Common/Backup/ZipBackup.php +++ b/system/src/Grav/Common/Backup/ZipBackup.php @@ -22,7 +22,8 @@ class ZipBackup ]; protected static $ignoreFolders = [ - '.git' + '.git', + '.idea' ]; public static function backup($destination = null, callable $messager = null) @@ -97,7 +98,10 @@ class ZipBackup // Remove prefix from file path before add to zip. $localPath = substr($filePath, $exclusiveLength); - if (in_array($f, static::$ignoreFolders) || in_array($localPath, static::$ignorePaths)) { + if (in_array($f, static::$ignoreFolders)) { + continue; + } elseif (in_array($localPath, static::$ignorePaths)) { + $zipFile->addEmptyDir($f); continue; }