In the Application.php
constructor of lumen, how to start the container
<code>vendor/laravel/lumen-framework/src/Application.php line:103 </code>
<code>vendor/illuminate/container/Container.php line:1159 </code>
I don’t understand its function and purpose.
In the Application.php
constructor of lumen, how to start the container
<code>vendor/laravel/lumen-framework/src/Application.php line:103 </code>
<code>vendor/illuminate/container/Container.php line:1159 </code>
I don’t understand its function and purpose.
Looked at the source code of Lumen 5.3:
<code class="php">protected function bootstrapContainer() { static::setInstance($this); $this->instance('app', $this); $this->instance('Laravel\Lumen\Application', $this); $this->instance('path', $this->path()); $this->registerContainerAliases(); }</code>
Combined with $this->instance(...)
, it is to implement the singleton mode.