@@ -228,46 +228,33 @@ private function createStore(): void
228
228
*/
229
229
private function findAssets (): void
230
230
{
231
+ // Assets supplied by packages.
231
232
$ plaisioXmlList = PlaisioXmlUtility::findPlaisioXmlPackages ('assets ' );
233
+ $ collections = [];
232
234
foreach ($ plaisioXmlList as $ plaisioConfigPath )
233
235
{
234
236
$ helper = new AssetsPlaisioXmlHelper ($ plaisioConfigPath );
235
- $ collections = $ helper ->queryAssetFileList ();
236
- if (!empty ($ collections ))
237
- {
238
- foreach ($ collections as $ collection )
239
- {
240
- foreach ($ collection ['files ' ] as $ file )
241
- {
242
- $ this ->io ->logVerbose ('Found asset <fso>%s</fso> ' , Path::join ($ collection ['base-dir ' ], $ file ));
243
-
244
- $ this ->store ->insertRow ('PLS_ASSET ' , ['ass_id ' => null ,
245
- 'ass_type ' => $ collection ['type ' ],
246
- 'ass_base_dir ' => $ collection ['base-dir ' ],
247
- 'ass_to_dir ' => $ collection ['to-dir ' ],
248
- 'ass_path ' => $ file ]);
249
- }
250
- }
251
- }
237
+ $ tmp = $ helper ->queryAssetFileList ();
238
+ $ collections = array_merge ($ collections , $ tmp );
252
239
}
253
240
241
+ // Third party assets.
254
242
$ plaisioConfigPath = PlaisioXmlUtility::plaisioXmlPath ('assets ' );
255
243
$ helper = new AssetsPlaisioXmlHelper ($ plaisioConfigPath );
256
- $ collections = $ helper ->queryOtherAssetFileList ();
257
- if (!empty ($ collections ))
244
+ $ tmp = $ helper ->queryOtherAssetFileList ();
245
+ $ collections = array_merge ($ collections , $ tmp );
246
+
247
+ foreach ($ collections as $ collection )
258
248
{
259
- foreach ($ collections as $ collection )
249
+ foreach ($ collection [ ' files ' ] as $ file )
260
250
{
261
- foreach ($ collection ['files ' ] as $ file )
262
- {
263
- $ this ->io ->logVerbose ('Found asset <fso>%s</fso> ' , Path::join ($ collection ['base-dir ' ], $ file ));
264
-
265
- $ this ->store ->insertRow ('PLS_ASSET ' , ['ass_id ' => null ,
266
- 'ass_type ' => $ collection ['type ' ],
267
- 'ass_base_dir ' => $ collection ['base-dir ' ],
268
- 'ass_to_dir ' => $ collection ['to-dir ' ],
269
- 'ass_path ' => $ file ]);
270
- }
251
+ $ this ->io ->logVerbose ('Found asset <fso>%s</fso> ' , Path::join ($ collection ['base-dir ' ], $ file ));
252
+
253
+ $ this ->store ->insertRow ('PLS_ASSET ' , ['ass_id ' => null ,
254
+ 'ass_type ' => $ collection ['type ' ],
255
+ 'ass_base_dir ' => $ collection ['base-dir ' ],
256
+ 'ass_to_dir ' => $ collection ['to-dir ' ],
257
+ 'ass_path ' => $ file ]);
271
258
}
272
259
}
273
260
}
0 commit comments