1 | <?php |
||
9 | class FileSelection |
||
10 | { |
||
11 | /** @var \Illuminate\Support\Collection */ |
||
12 | protected $includeFilesAndDirectories; |
||
13 | |||
14 | /** @var \Illuminate\Support\Collection */ |
||
15 | protected $excludeFilesAndDirectories; |
||
16 | |||
17 | /** @var bool */ |
||
18 | protected $shouldFollowLinks = false; |
||
19 | |||
20 | /** |
||
21 | * @param array|string $includeFilesAndDirectories |
||
22 | * |
||
23 | * @return \Spatie\Backup\Tasks\Backup\FileSelection |
||
24 | */ |
||
25 | public static function create($includeFilesAndDirectories = []) |
||
29 | |||
30 | /** |
||
31 | * @param array|string $includeFilesAndDirectories |
||
32 | */ |
||
33 | 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) |
||
52 | |||
53 | /** |
||
54 | * Enable or disable the following of symlinks. |
||
55 | * |
||
56 | * @param bool $shouldFollowLinks |
||
57 | * |
||
58 | * @return \Spatie\Backup\Tasks\Backup\FileSelection |
||
59 | */ |
||
60 | public function shouldFollowLinks($shouldFollowLinks) |
||
66 | |||
67 | /** |
||
68 | * @return \Illuminate\Support\Collection |
||
69 | */ |
||
70 | public function getSelectedFiles() |
||
91 | |||
92 | /** |
||
93 | * Make a unique array of all files from a given array of files and directories. |
||
94 | * |
||
95 | * @param \Illuminate\Support\Collection $paths |
||
96 | * |
||
97 | * @return \Illuminate\Support\Collection |
||
98 | */ |
||
99 | protected function getAllFilesFromPaths(Collection $paths) |
||
117 | |||
118 | /** |
||
119 | * Recursively get all the files within a given directory. |
||
120 | * |
||
121 | * @param string $directory |
||
122 | * |
||
123 | * @return \Illuminate\Support\Collection |
||
124 | */ |
||
125 | protected function getAllFilesFromDirectory($directory) |
||
143 | |||
144 | /** |
||
145 | * Fully expand paths, and reject non-existing paths. |
||
146 | * |
||
147 | * @param $paths |
||
148 | * |
||
149 | * @return \Illuminate\Support\Collection |
||
150 | */ |
||
151 | protected function createPathCollection($paths) |
||
164 | } |
||
165 |