ignore all .git folders

This commit is contained in:
Gert
2015-04-28 23:35:58 +02:00
parent e364616730
commit bbfc63e943

View File

@@ -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;
}