File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 22
22
"require" : {
23
23
"php" : " >=5.4.0" ,
24
24
"illuminate/support" : " 5.*" ,
25
- "illuminate/console" : " 5.*"
25
+ "illuminate/console" : " 5.*" ,
26
+ "symfony/finder" : " ~2.6"
26
27
27
28
},
28
29
"require-dev" : {
Original file line number Diff line number Diff line change 5
5
use File ;
6
6
use Spatie \Backup \BackupHandlers \BackupHandlerInterface ;
7
7
use SplFileInfo ;
8
+ use Symfony \Component \Finder \Finder ;
8
9
9
10
class FilesBackupHandler implements BackupHandlerInterface
10
11
{
@@ -65,12 +66,23 @@ public function getAllPathFromFileArray($fileArray)
65
66
}
66
67
67
68
if (File::isDirectory ($ file )) {
68
- $ files = array_merge ($ files , File:: allFiles ($ file ));
69
+ $ files = array_merge ($ files , $ this -> getAllFilesFromDirectory ($ file ));
69
70
}
70
71
}
71
72
72
73
return array_unique (array_map (function (SplFileInfo $ file ) {
73
74
return $ file ->getPathName ();
74
75
}, $ files ));
75
76
}
77
+
78
+ protected function getAllFilesFromDirectory ($ directory )
79
+ {
80
+ $ finder = (new Finder ())
81
+ ->ignoreDotFiles (false )
82
+ ->ignoreVCS (false )
83
+ ->files ()
84
+ ->in ($ directory );
85
+
86
+ return iterator_to_array ($ finder );
87
+ }
76
88
}
You can’t perform that action at this time.
0 commit comments