mirror of
https://github.com/getgrav/grav.git
synced 2026-07-20 09:51:02 +02:00
Fix for issue #225 - zip skipping required empty folders
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user