The build method passes in the entire project root path (the public folder on the previous level) and sets it as the underlying path (in the presence of this class BasePath attribute). __construct > Setbasepath > Bindpathsincontainer binding Path in container bindpathsincontainer > instance registering an existing instance in a container {$ This->removeabstractalias ($abstract); This method first removes the corresponding instance alias in the container (abstractaliases differs from aliases, in doubt) $this->rebound Then, if the key name is present in the bindings property instances property Aliases property, the callback function that is bound when the instance is registered before it is run is updated $this->instances[$abstract] = $instance Finally add the path to the Instances property} __construct > Registerbasebindings{static::setinstance ($this) Registering the application instance to the Container abstract base class makes it globally available to bind the Packagemanifest class to Illuminate\container\container binding to the application class. Vendor path and service provider path in bootstrap/cache/packages.php} __construct > Registerbaseserviceproviders registered event, log, The routed service provider passes in the corresponding provider instance and invokes its register method, passing the application instance into the provider as a parameter callback. Routingserviceprovider in the instantiation of the time, but also registered router, Urlgenerator, redirector, request, response, dispatcher and other instances of the class. Mark registered provider with $this->serviceproviders, $this->loadedproviders[get_class ($provider)] Finally, we traced the bind method to the container class, and just added the callback function to the bindings attribute, and set the$app->singleton__construct > registercorecontaineraliases the core class path into $this->aliases (the alias is the key, the class name is the value) and the This->abstractaliases (The class name is a key, the path consists of an array of values), save the alias
laravel5.5 Source Read Draft--application