1 | <?php |
||
9 | trait Art |
||
10 | { |
||
11 | /** |
||
12 | * The directories we should be looking for art in |
||
13 | * |
||
14 | * @var array $art_dirs |
||
15 | */ |
||
16 | protected $art_dirs = []; |
||
17 | |||
18 | /** |
||
19 | * The default art if we can't find what the user requested |
||
20 | * |
||
21 | * @var string $default_art |
||
22 | */ |
||
23 | protected $default_art = '404'; |
||
24 | |||
25 | /** |
||
26 | * The art requested by the user |
||
27 | * |
||
28 | * @var string $art |
||
29 | */ |
||
30 | protected $art = ''; |
||
31 | |||
32 | /** |
||
33 | 80 | * Specify which settings Draw needs to import |
|
34 | * |
||
35 | 80 | * @return array |
|
36 | */ |
||
37 | public function settings() |
||
41 | |||
42 | /** |
||
43 | 44 | * Import the Art setting (any directories the user added) |
|
44 | * |
||
45 | 44 | * @param \League\CLImate\Settings\Art $setting |
|
46 | 44 | */ |
|
47 | 44 | public function importSettingArt($setting) |
|
53 | |||
54 | /** |
||
55 | 80 | * Add a directory to search for art in |
|
56 | * |
||
57 | * @param string $dir |
||
58 | */ |
||
59 | 80 | protected function addDir($dir) |
|
70 | |||
71 | /** |
||
72 | * Find a valid art path |
||
73 | * |
||
74 | 4 | * @param string $art |
|
75 | * |
||
76 | 4 | * @return array |
|
77 | */ |
||
78 | protected function artDir($art) |
||
82 | |||
83 | /** |
||
84 | * Find a valid art path |
||
85 | * |
||
86 | 76 | * @param string $art |
|
87 | * |
||
88 | 76 | * @return string |
|
89 | */ |
||
90 | 76 | protected function artFile($art) |
|
105 | |||
106 | /** |
||
107 | * Find a set of files in the current art directories |
||
108 | * based on a pattern |
||
109 | * |
||
110 | * @param string $art |
||
111 | 80 | * @param string $pattern |
|
112 | * |
||
113 | 80 | * @return array |
|
114 | 80 | */ |
|
115 | protected function fileSearch($art, $pattern) |
||
144 | |||
145 | /** |
||
146 | * Parse the contents of the file and return each line |
||
147 | * |
||
148 | 80 | * @param string $path |
|
149 | * |
||
150 | 80 | * @return array |
|
151 | 80 | */ |
|
152 | 80 | protected function parse($path) |
|
160 | } |
||
161 |