Closed RobinRadic closed 1 year ago
Also, why not use the previously registered 'singleton' composer.json
that is registered in registerComposerJson
;
IMO. when you are already calling this same code in registerAddons, you might want to make registerComposerJSon
into a $this->app->instance('composer.json', json_decode(file_get_contents(base_path('composer.json')), true,512,JSON_THROW_ON_ERROR));
Because it is certain that its going to be accessed later in the lifecycle
Also, anything that is called from boot, in term of naming, i think it would be better to:
bootAddons
instead of registerAddons
as it is called from the boot lifecycle function.
This has since been cleaned up and implemented similarly to as mentioned here.
This has since been cleaned up and implemented similarly to as mentioned here.
Gr8
The composer vendor dir path might be usefull in other places, like third party addons. I recommend
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:This will make developers not only aware that something is wrong, but where the error is located