每天laravel-20160805| Container -8
来源:互联网 发布:淘宝 软件 编辑:程序博客网 时间:2024/06/07 10:34
/** * Register an existing instance as shared in the container. * * @param string $abstract * @param mixed $instance * @return void */ public function instance($abstract, $instance)// Register an existing instance as shared in the container. { $abstract = $this->normalize($abstract);// get a normal string. // First, we will extract the alias from the abstract if it is an array so we // are using the correct name when binding the type. If we get an alias it // will be registered with the container so we can resolve it out later. if (is_array($abstract)) {// check it is a array list($abstract, $alias) = $this->extractAlias($abstract);// list the array to the variable. // like extract function $this->alias($abstract, $alias);// set alias by abstract and alias } // First, we will extract the alias from the abstract if it is an array. // so we are using the correct name when binding the type. // if we get an alias it will be registered the container so we can resolve it out later. unset($this->aliases[$abstract]);// un set the aliases by key ,the key is abstract class. // We'll check to determine if this type has been bound before, and if it has // we will fire the rebound callbacks registered with the container and it // can be updated with consuming classes that have gotten resolved here. $bound = $this->bound($abstract); // we will check to determine if this type has been bound before, // and if it has we will fire the rebound callbacks registered with the container // and it can be updated with consuming classes that have gotten resolved here. $this->instances[$abstract] = $instance;// set instance if ($bound) { $this->rebound($abstract);// if it is bound ,use the rebound function. } }// last we has a summary // this function has two base action // one is abstract,other is bounding // set the instance and alias
0 0
- 每天laravel-20160805| Container -8
- 每天laravel-20160805| Container -8
- 每天laravel-20160730| Container -2
- 每天laravel-20160731| Container -3
- 每天laravel-20160801| Container -4
- 每天laravel-20160802| Container -5
- 每天laravel-20160803| Container -6
- 每天laravel-20160804| Container -7
- 每天laravel-20160807| Container -10
- 每天laravel-20160808| Container -11
- 每天laravel-20160809| Container -12
- 每天laravel-20160810| Container -13
- 每天laravel-20160811| Container -14
- 每天laravel-20160812| Container -15
- 每天laravel-20160813| Container -16
- 每天laravel-20160814| Container -17
- 每天laravel-20160815| Container -18
- 每天laravel-20160816| Container -19
- GET和POST的真正区别
- odoo 性能调优以及负载均衡
- 爬虫入门(1)
- mina iobuffer byte[]、String之间转换
- 最大整数 贪心***
- 每天laravel-20160805| Container -8
- 欢迎使用CSDN-markdown编辑器
- go语言学习2
- Android Intent设置类型setType();
- python装饰器(decorator)
- 跳槽最惨的情况,不看要悲剧!
- JAVA基本数据类型和数据类型转换
- 4.临时构造器
- 链表的回文结构