1 | <?php |
||
9 | class FileSelection |
||
10 | { |
||
11 | /** @var array */ |
||
12 | protected $includeFilesAndDirectories = []; |
||
13 | |||
14 | /** @var array */ |
||
15 | protected $excludeFilesAndDirectories = []; |
||
16 | |||
17 | /** |
||
18 | * @param array|string $includeFilesAndDirectories |
||
19 | * |
||
20 | * @return \Spatie\Backup\Tasks\Backup\FileSelection |
||
21 | */ |
||
22 | public static function create($includeFilesAndDirectories = []) |
||
26 | |||
27 | /** |
||
28 | * @param array|string $includeFilesAndDirectories |
||
29 | */ |
||
30 | public function __construct($includeFilesAndDirectories) |
||
38 | |||
39 | /** |
||
40 | * Do not included the given files and directories. |
||
41 | * |
||
42 | * @param array|string $excludeFilesAndDirectories |
||
43 | * |
||
44 | * @return \Spatie\Backup\Tasks\Backup\FileSelection |
||
45 | */ |
||
46 | public function excludeFilesFrom($excludeFilesAndDirectories) |
||
56 | |||
57 | /** |
||
58 | * @return array |
||
59 | */ |
||
60 | public function getSelectedFiles() |
||
84 | |||
85 | /** |
||
86 | * Make a unique array of all files from a given array of files and directories. |
||
87 | * |
||
88 | * @param array $paths |
||
89 | * |
||
90 | * @return array |
||
91 | */ |
||
92 | protected function getAllFilesFromPaths(array $paths) |
||
115 | |||
116 | /** |
||
117 | * Recursively get all the files within a given directory. |
||
118 | * |
||
119 | * @param string $directory |
||
120 | * |
||
121 | * @return array |
||
122 | */ |
||
123 | protected function getAllFilesFromDirectory($directory) |
||
139 | |||
140 | /** |
||
141 | * Check all paths in array for a wildcard (*) and build a new array from the results. |
||
142 | * |
||
143 | * @param array $paths |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | protected function expandWildCardPaths(array $paths) |
||
156 | } |
||
157 |