-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
The composer vendor dir path might be usefull in other places, like third party addons. I recommend
$composer = json_decode(file_get_contents(base_path('composer.json')), true);
$lock = json_decode(file_get_contents(base_path('composer.lock')), true);
if ($directory = Arr::get($composer, 'config.vendor-dir')) {
$directory = base_path($directory);
}
if (!$directory) {
$directory = base_path('vendor');
}
the directory value coming from this to be bound in container. So it is re-usable. No need to check this twice.
I also recommend adding the JSON_THROW_ON_ERROR
flag:
json_decode(file_get_contents(base_path('composer.json')), true,512,JSON_THROW_ON_ERROR);
This will make developers not only aware that something is wrong, but where the error is located
Metadata
Metadata
Assignees
Labels
No labels