1 | <?php |
||
7 | class FileSelection |
||
8 | { |
||
9 | /** @var \Illuminate\Support\Collection */ |
||
10 | protected $includeFilesAndDirectories; |
||
11 | |||
12 | /** @var \Illuminate\Support\Collection */ |
||
13 | protected $excludeFilesAndDirectories; |
||
14 | |||
15 | /** @var bool */ |
||
16 | protected $shouldFollowLinks = false; |
||
17 | |||
18 | /** |
||
19 | * @param array|string $includeFilesAndDirectories |
||
20 | * |
||
21 | * @return \Spatie\Backup\Tasks\Backup\FileSelection |
||
22 | */ |
||
23 | public static function create($includeFilesAndDirectories = []) |
||
27 | |||
28 | /** |
||
29 | * @param array|string $includeFilesAndDirectories |
||
30 | */ |
||
31 | public function __construct($includeFilesAndDirectories) |
||
37 | |||
38 | /** |
||
39 | * Do not included the given files and directories. |
||
40 | * |
||
41 | * @param array|string $excludeFilesAndDirectories |
||
42 | * |
||
43 | * @return \Spatie\Backup\Tasks\Backup\FileSelection |
||
44 | */ |
||
45 | public function excludeFilesFrom($excludeFilesAndDirectories) |
||
51 | |||
52 | /** |
||
53 | * Enable or disable the following of symlinks. |
||
54 | * |
||
55 | * @param bool $shouldFollowLinks |
||
56 | * |
||
57 | * @return \Spatie\Backup\Tasks\Backup\FileSelection |
||
58 | */ |
||
59 | public function shouldFollowLinks($shouldFollowLinks) |
||
65 | |||
66 | /** |
||
67 | * @return Generator|string |
||
68 | */ |
||
69 | public function getSelectedFiles() |
||
99 | |||
100 | /** |
||
101 | * @return array |
||
102 | */ |
||
103 | protected function includedFiles() |
||
109 | |||
110 | /** |
||
111 | * @return array |
||
112 | */ |
||
113 | protected function includedDirectories() |
||
119 | |||
120 | /** |
||
121 | * @param string $path |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | protected function shouldExclude($path) |
||
131 | |||
132 | /** |
||
133 | * @param $paths |
||
134 | * |
||
135 | * @return static |
||
136 | */ |
||
137 | protected function createPathCollection($paths) |
||
153 | } |
||
154 |