From bbfc63e94308adb0b48fbcf778e0c3fa12110f38 Mon Sep 17 00:00:00 2001 From: Gert Date: Tue, 28 Apr 2015 23:35:58 +0200 Subject: [PATCH] ignore all .git folders --- system/src/Grav/Common/Backup/ZipBackup.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Backup/ZipBackup.php b/system/src/Grav/Common/Backup/ZipBackup.php index 2951cf9bf..d275d21eb 100644 --- a/system/src/Grav/Common/Backup/ZipBackup.php +++ b/system/src/Grav/Common/Backup/ZipBackup.php @@ -14,14 +14,17 @@ class ZipBackup { use GravTrait; - protected static $ignore = [ - '.git', + protected static $ignorePaths = [ 'backup', 'cache', 'images', 'logs' ]; + protected static $ignoreFolders = [ + '.git' + ]; + public static function backup($destination = null, callable $messager = null) { if (!$destination) { @@ -94,7 +97,7 @@ class ZipBackup // Remove prefix from file path before add to zip. $localPath = substr($filePath, $exclusiveLength); - if (in_array($localPath, static::$ignore)) { + if (in_array($f, static::$ignoreFolders) || in_array($localPath, static::$ignorePaths)) { continue; }