1 | <?php |
||
5 | trait Art |
||
6 | { |
||
7 | /** |
||
8 | * The directories we should be looking for art in |
||
9 | * |
||
10 | * @var array $art_dirs |
||
11 | */ |
||
12 | protected $art_dirs = []; |
||
13 | |||
14 | /** |
||
15 | * The default art if we can't find what the user requested |
||
16 | * |
||
17 | * @var string $default_art |
||
18 | */ |
||
19 | protected $default_art = '404'; |
||
20 | |||
21 | /** |
||
22 | * The art requested by the user |
||
23 | * |
||
24 | * @var string $art |
||
25 | */ |
||
26 | protected $art = ''; |
||
27 | |||
28 | /** |
||
29 | * Specify which settings Draw needs to import |
||
30 | * |
||
31 | * @return array |
||
32 | */ |
||
33 | 80 | public function settings() |
|
37 | |||
38 | /** |
||
39 | * Import the Art setting (any directories the user added) |
||
40 | * |
||
41 | * @param \League\CLImate\Settings\Art $setting |
||
42 | */ |
||
43 | 44 | public function importSettingArt($setting) |
|
49 | |||
50 | /** |
||
51 | * Add a directory to search for art in |
||
52 | * |
||
53 | * @param string $dir |
||
54 | */ |
||
55 | 80 | protected function addDir($dir) |
|
66 | |||
67 | /** |
||
68 | * Find a valid art path |
||
69 | * |
||
70 | * @param string $art |
||
71 | * |
||
72 | * @return array |
||
73 | */ |
||
74 | 4 | protected function artDir($art) |
|
78 | |||
79 | /** |
||
80 | * Find a valid art path |
||
81 | * |
||
82 | * @param string $art |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | 76 | protected function artFile($art) |
|
101 | |||
102 | /** |
||
103 | * Find a set of files in the current art directories |
||
104 | * based on a pattern |
||
105 | * |
||
106 | * @param string $art |
||
107 | * @param string $pattern |
||
108 | * |
||
109 | * @return array |
||
110 | */ |
||
111 | 80 | protected function fileSearch($art, $pattern) |
|
140 | |||
141 | /** |
||
142 | * Parse the contents of the file and return each line |
||
143 | * |
||
144 | * @param string $path |
||
145 | * |
||
146 | * @return array |
||
147 | */ |
||
148 | 80 | protected function parse($path) |
|
156 | } |
||
157 |