Closed Orclyx closed 1 year ago
Good catch! Thanks for adding this.
I was just testing it and getting an error when including the data files as it adds the base_path
again to each file on line 56 (https://github.com/area17/blast/blob/1.x/src/DataStore.php#L56).
If you could remove the base_path
here as part of this PR we should be good to merge. Thanks!
@mrtimbrook Ah have changed, thanks.
It occurred to me that this isn't as close to how getVendorPath() works as maybe it ought to be: if you set a relative vendor_path in the blast.php config file then getVendorPath will apply base_path(), but it won't if vendor_path is absolute (good). If you set a relative base_path in config that probably won't work any more which seems bad. Happy to iterate on this further to solve if you'd like.
I think you're right and it makes sense to follow the same pattern as the getVendorPath()
method.
Have reworked and added tests for the different scenarios:
Sorry for the delayed reply. This all looks great (the tests are 🔥 )! Thanks for your work.
This wraps the default value used for
data_path
with base_path(), which provides similar handling to what is being done in getVendorPath() already.The relative data_path was causing an issue where when running a Laravel worker process, the relative path seemed to be relative to somewhere other than the base path and the worker didn't have permission to write there. This caused a fatal error similar to the one described in https://github.com/area17/blast/issues/61