In the lumen Application. php constructor, the method for starting the container {code...} does not understand its role and purpose.
In lumen'sApplication.phpHow to start a container in Constructor
vendor/laravel/lumen-framework/src/Application.php line:103
vendor/illuminate/container/Container.php line:1159
Do not understand its role and purpose.
Reply content:
In lumen'sApplication.phpHow to start a container in Constructor
vendor/laravel/lumen-framework/src/Application.php line:103
vendor/illuminate/container/Container.php line:1159
Do not understand its role and purpose.
Read the Lumen 5.3 source code:
protected function bootstrapContainer(){ static::setInstance($this); $this->instance('app', $this); $this->instance('Laravel\Lumen\Application', $this); $this->instance('path', $this->path()); $this->registerContainerAliases();}
Integration$this->instance(...)The Singleton mode is implemented.