您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

关于lumen源码疑问

2024/5/4 7:16:08发布211次查看
在lumen的application.php构造函数中,启动容器的方法
vendor/laravel/lumen-framework/src/application.php line:103

vendor/illuminate/container/container.php line:1159

不明白其作用,以及目的。
回复内容: 在lumen的application.php构造函数中,启动容器的方法
vendor/laravel/lumen-framework/src/application.php line:103

vendor/illuminate/container/container.php line:1159

不明白其作用,以及目的。
看了下 lumen 5.3 的源码:
protected function bootstrapcontainer(){ static::setinstance($this); $this->instance('app', $this); $this->instance('laravel\lumen\application', $this); $this->instance('path', $this->path()); $this->registercontaineraliases();}
结合 $this->instance(...) 来看,就是实现单例模式。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product