Questions about lumen source code

WBOY
Release: 2016-10-11 14:23:15
Original
1036 people have browsed it

In the Application.php constructor of lumen, how to start the container

Questions about lumen source code

<code>vendor/laravel/lumen-framework/src/Application.php line:103 
</code>
Copy after login
Copy after login

Questions about lumen source code

<code>vendor/illuminate/container/Container.php line:1159
</code>
Copy after login
Copy after login

I don’t understand its function and purpose.

Reply content:

In the Application.php constructor of lumen, how to start the container

Questions about lumen source code

<code>vendor/laravel/lumen-framework/src/Application.php line:103 
</code>
Copy after login
Copy after login

Questions about lumen source code

<code>vendor/illuminate/container/Container.php line:1159
</code>
Copy after login
Copy after login

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>
Copy after login

Combined with $this->instance(...), it is to implement the singleton mode.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!