18
18
19
19
class iconify_bundler
20
20
{
21
- /** @var log_interface */
22
- protected $ log ;
21
+ /** @var string Icons path */
22
+ protected string $ icons_path ;
23
23
24
24
/** @var string[] Icons list */
25
25
protected $ icons_list = [];
@@ -28,10 +28,11 @@ class iconify_bundler
28
28
* Constructor for iconify bundler
29
29
*
30
30
* @param log_interface|null $log Logger
31
+ * @param string $root_path phpBB root path
31
32
*/
32
- public function __construct (?log_interface $ log )
33
+ public function __construct (protected ?log_interface $ log, string $ root_path )
33
34
{
34
- $ this ->log = $ log ;
35
+ $ this ->icons_path = $ root_path . ' assets/iconify/ ' ;
35
36
}
36
37
37
38
/**
@@ -206,6 +207,17 @@ protected function name_to_icon(string $icon_name): ?array
206
207
return null ;
207
208
}
208
209
210
+ /**
211
+ * Get collection path for prefix
212
+ *
213
+ * @param string $prefix Icon collection prefix
214
+ * @return string Icon collection path
215
+ */
216
+ protected function get_collection_path (string $ prefix ): string
217
+ {
218
+ return $ this ->icons_path . $ prefix . '.json ' ;
219
+ }
220
+
209
221
/**
210
222
* Load icons date for supplied icons array
211
223
*
@@ -220,7 +232,7 @@ protected function load_icons_data(array $icons): string
220
232
{
221
233
// Load icon set
222
234
$ collection = new Collection ($ prefix );
223
- $ collection_file = Collection:: findIconifyCollection ($ prefix );
235
+ $ collection_file = $ this -> get_collection_path ($ prefix );
224
236
if (!file_exists ($ collection_file ) || !$ collection ->loadFromFile ($ collection_file ))
225
237
{
226
238
$ this ->log ?->add('critical ' , ANONYMOUS , '' , 'LOG_ICON_COLLECTION_INVALID ' , false , [$ prefix ]);
0 commit comments